eser 4.1.23 → 4.1.27
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/chunks/add-ORJYWG26.js +7 -0
- package/chunks/{anthropic-GBDSASP5.js → anthropic-SL274RBQ.js} +1 -1
- package/chunks/approve-5NJ4JWD3.js +1 -0
- package/chunks/ask-TFJCKH5G.js +2 -0
- package/chunks/block-ADHHHUFZ.js +1 -0
- package/chunks/{browser-6UKLTPJO.js → browser-XCMD2IZQ.js} +1 -1
- package/chunks/{build-VKOO2WEA.js → build-2W7YVR7J.js} +2 -2
- package/chunks/{bun-N3TIWBPP.js → bun-YFFBDKUJ.js} +1 -1
- package/chunks/changelog-gen-QDUA5G5K.js +9 -0
- package/chunks/chunk-2J2PXBOC.js +1 -0
- package/chunks/{chunk-NIX3WX3O.js → chunk-3EFU5R2M.js} +1 -1
- package/chunks/{chunk-7GS5KPVF.js → chunk-3I4JG3PJ.js} +1 -1
- package/chunks/{chunk-7QNRH7OR.js → chunk-3K42AALS.js} +1 -1
- package/chunks/{chunk-TMFPDVYN.js → chunk-3OEM65F2.js} +17 -17
- package/chunks/{chunk-RGUC6KAZ.js → chunk-4H4O3TGK.js} +1 -1
- package/chunks/{chunk-V5HTJPFW.js → chunk-4HAIX3WN.js} +3 -3
- package/chunks/chunk-4VL2RZIN.js +1 -0
- package/chunks/chunk-5AK4OGCO.js +1 -0
- package/chunks/chunk-5MN3MWQN.js +1 -0
- package/chunks/chunk-5RK3346P.js +4 -0
- package/chunks/chunk-6HYGGBEQ.js +1 -0
- package/chunks/{chunk-PLRSDG6G.js → chunk-762C2IM6.js} +1 -1
- package/chunks/{chunk-NZFUFGOC.js → chunk-AAV7D6DF.js} +1 -1
- package/chunks/{chunk-DLVQNMNV.js → chunk-AKJB4CER.js} +1 -1
- package/chunks/{chunk-NSZ4HGDI.js → chunk-ANY26ROY.js} +1 -1
- package/chunks/{chunk-IAWIWTDY.js → chunk-AYSPDG4K.js} +1 -1
- package/chunks/{chunk-DOV5776P.js → chunk-BCHXUKWW.js} +2 -2
- package/chunks/{chunk-3DMTTLUJ.js → chunk-BDTJR6UH.js} +1 -1
- package/chunks/{chunk-BP2MZX2P.js → chunk-C3PZVQ3Z.js} +1 -1
- package/chunks/{chunk-M5TBBQQC.js → chunk-CKD2KOHA.js} +3 -3
- package/chunks/chunk-CPRLAMEG.js +1 -0
- package/chunks/chunk-DWYVBWBP.js +91 -0
- package/chunks/{chunk-O2MNBI7V.js → chunk-EBYJBBYV.js} +1 -1
- package/chunks/{chunk-PBSR4XR2.js → chunk-ETMOOGY2.js} +1 -1
- package/chunks/chunk-G34MS4XJ.js +1 -0
- package/chunks/chunk-GVSBZ6JV.js +1 -0
- package/chunks/{chunk-C3OSYHJY.js → chunk-H4OFOQQ2.js} +1 -1
- package/chunks/{chunk-XWYLEYLY.js → chunk-HTBLWLKV.js} +1 -1
- package/chunks/chunk-JOXKA7TJ.js +7 -0
- package/chunks/{chunk-JQHMDTPL.js → chunk-KAEAT6A4.js} +1 -1
- package/chunks/chunk-LOFP256P.js +1 -0
- package/chunks/{chunk-2R4MK2KR.js → chunk-MYSTBVWT.js} +1 -1
- package/chunks/chunk-NGZZAQ7G.js +1 -0
- package/chunks/chunk-NLNSK3KE.js +1 -0
- package/chunks/chunk-NT2MQK7O.js +6 -0
- package/chunks/{chunk-SJQWPBMJ.js → chunk-NTPOK5H6.js} +1 -1
- package/chunks/{chunk-DZD6MI45.js → chunk-PO3SXFUE.js} +1 -1
- package/chunks/chunk-Q54LOR4S.js +2 -0
- package/chunks/{chunk-5C7ZQN6X.js → chunk-QIODVVTY.js} +1 -1
- package/chunks/{chunk-ZY72QNKZ.js → chunk-QIYWONJL.js} +1 -1
- package/chunks/chunk-QZY4BKI7.js +1 -0
- package/chunks/chunk-RBB5ITAS.js +2 -0
- package/chunks/chunk-RYLOB2JU.js +1 -0
- package/chunks/{chunk-VFMYWG2I.js → chunk-SBOTNOWZ.js} +1 -1
- package/chunks/{chunk-Z7742D7Q.js → chunk-SG4G3OOO.js} +1 -1
- package/chunks/{chunk-FGDJVQG3.js → chunk-TTYO2XJO.js} +1 -1
- package/chunks/{chunk-EW5NCPPE.js → chunk-TUTRX7VR.js} +3 -3
- package/chunks/{chunk-UJX2S56V.js → chunk-TXL6YOFL.js} +1 -1
- package/chunks/{chunk-4Q3SEHPE.js → chunk-U47ABJCC.js} +1 -1
- package/chunks/chunk-U65FD6J3.js +1 -0
- package/chunks/{chunk-7M3ONEMO.js → chunk-UKYKMDYU.js} +1 -1
- package/chunks/{chunk-DRQWYJMH.js → chunk-UNL4H5EY.js} +1 -1
- package/chunks/{chunk-ATLUGTI7.js → chunk-V2N5L24J.js} +2 -2
- package/chunks/chunk-VVHXAOEH.js +1 -0
- package/chunks/{chunk-HPVL4BVQ.js → chunk-W3REWI3H.js} +2 -2
- package/chunks/{chunk-MQH4XBFN.js → chunk-XMCQMTAA.js} +1 -1
- package/chunks/chunk-YMY2URYM.js +1 -0
- package/chunks/{chunk-XJ3VEVYL.js → chunk-YQU3TEIG.js} +1 -1
- package/chunks/chunk-YWCEHTZB.js +2 -0
- package/chunks/chunk-YXSB6RET.js +1 -0
- package/chunks/chunk-Z4WPWVC7.js +10 -0
- package/chunks/chunk-ZED5RIVL.js +1 -0
- package/chunks/chunk-ZH37DSUQ.js +1 -0
- package/chunks/chunk-ZO7RUTSQ.js +60 -0
- package/chunks/claude-code-K37KYX7W.js +1 -0
- package/chunks/clone-PAQMCIA3.js +5 -0
- package/chunks/{commitmsg-SQRQONCS.js → commitmsg-ZGOEO5YG.js} +2 -2
- package/chunks/{deno-PZXN5K3J.js → deno-MMJLKXAE.js} +1 -1
- package/chunks/{dev-FLO2KEPZ.js → dev-JHAHGTZP.js} +2 -2
- package/chunks/file-tools-shared-77P7MI54.js +1 -0
- package/chunks/gemini-ARTUPDPZ.js +1 -0
- package/chunks/gh-SXEDNWHD.js +4 -0
- package/chunks/{gh-contributors-5SHGJHAQ.js → gh-contributors-G3QZZAUO.js} +3 -3
- package/chunks/init-3GXDO32O.js +1 -0
- package/chunks/init-IPZHDMAH.js +12 -0
- package/chunks/install-VY2L6NDB.js +2 -0
- package/chunks/kiro-XQDHURLU.js +1 -0
- package/chunks/{list-MN7OUE52.js → list-2RZIQZGH.js} +1 -1
- package/chunks/{list-B7L4FZKG.js → list-DSVIPH45.js} +1 -1
- package/chunks/{list-UZKWSA4S.js → list-V2HZCPDN.js} +1 -1
- package/chunks/load-config-KG4RTCR2.js +1 -0
- package/chunks/{main-WVXCURBF.js → main-FQFNY7SM.js} +2 -2
- package/chunks/manifest-5CYL3HR3.js +1 -0
- package/chunks/mod-5ACKR2OE.js +1 -0
- package/chunks/{mod-PEAFMI6F.js → mod-CUIGNRIK.js} +1 -1
- package/chunks/mod-NSY6WUYH.js +27 -0
- package/chunks/mod-QJMMYECF.js +10 -0
- package/chunks/{mod-CI56JMO4.js → mod-TLLZ3NAM.js} +2 -2
- package/chunks/mod-TSU5UWXA.js +1 -0
- package/chunks/{mod-JTBNNSZZ.js → mod-U6LEXPVR.js} +1 -1
- package/chunks/{mod-MKMQWZ6G.js → mod-VZPKQ7DG.js} +1 -1
- package/chunks/mod-WX4P6LGJ.js +1 -0
- package/chunks/mod-WYRORC72.js +1 -0
- package/chunks/new-EAETGSIR.js +4 -0
- package/chunks/next-F2BIIAZC.js +3 -0
- package/chunks/{node-VPHAK3FD.js → node-SMAAGOR3.js} +1 -1
- package/chunks/ollama-6JZ2IKR7.js +1 -0
- package/chunks/opencode-CHIAJALZ.js +1 -0
- package/chunks/recipe-applier-R4YJPGQR.js +1 -0
- package/chunks/registry-fetcher-J6X32PGP.js +1 -0
- package/chunks/{release-YJOLKWDT.js → release-3BKLVESS.js} +2 -2
- package/chunks/release-notes-734LKEJB.js +3 -0
- package/chunks/release-tag-YX727TXO.js +1 -0
- package/chunks/reset-PAPDZIDC.js +1 -0
- package/chunks/rule-4GNOR3GE.js +2 -0
- package/chunks/{run-7JXDS75G.js → run-ES4BLQQX.js} +1 -1
- package/chunks/{scripts-RSK5XDRW.js → scripts-COIXD5AD.js} +1 -1
- package/chunks/{serve-U6IXMGXQ.js → serve-B4V2BCWM.js} +2 -2
- package/chunks/{server-PXE4DB3V.js → server-RYWDAYED.js} +1 -1
- package/chunks/spec-SNAUMQSR.js +1 -0
- package/chunks/status-CY5IKIYS.js +1 -0
- package/chunks/sync-OAPV43JS.js +1 -0
- package/chunks/system-5A6DQLM5.js +1 -0
- package/chunks/system-JWO27FMA.js +1 -0
- package/chunks/update-O75M4SDJ.js +5 -0
- package/chunks/validate-bom-6G7EYFOP.js +1 -0
- package/chunks/validate-case-conflict-OWHWRTSQ.js +1 -0
- package/chunks/validate-circular-deps-TCYSZKME.js +1 -0
- package/chunks/validate-commit-msg-UPJJ7E4M.js +1 -0
- package/chunks/validate-docs-ZTCE5XLF.js +1 -0
- package/chunks/validate-eof-6RMNMAWI.js +1 -0
- package/chunks/validate-export-names-5ZVQ4PGM.js +1 -0
- package/chunks/validate-filenames-5YB27RN4.js +1 -0
- package/chunks/validate-json-6CLTN4AN.js +1 -0
- package/chunks/validate-large-files-KEMHYWKH.js +1 -0
- package/chunks/validate-licenses-WIVY6G5Z.js +1 -0
- package/chunks/validate-line-endings-KNFYAVBG.js +1 -0
- package/chunks/validate-merge-conflict-PYKGIFY5.js +1 -0
- package/chunks/validate-mod-exports-X5UZPD7J.js +1 -0
- package/chunks/validate-package-configs-SYKEIB53.js +1 -0
- package/chunks/validate-secrets-BWDFWN64.js +1 -0
- package/chunks/validate-shebangs-MP6VTLWO.js +1 -0
- package/chunks/validate-submodules-RQXISWKG.js +1 -0
- package/chunks/validate-symlinks-IPRYMDZD.js +1 -0
- package/chunks/validate-toml-KJZK7QVM.js +1 -0
- package/chunks/validate-trailing-whitespace-RO42VWQG.js +1 -0
- package/chunks/validate-yaml-H7G726ZM.js +1 -0
- package/chunks/versions-KW5UTMNV.js +1 -0
- package/chunks/vertexai-TPGIAJNA.js +1 -0
- package/chunks/workerd-LKKH32SO.js +1 -0
- package/eser.js +1 -1
- package/package.json +1 -1
- package/chunks/add-4LRHVBEC.js +0 -7
- package/chunks/approve-364KOMLB.js +0 -1
- package/chunks/ask-752YJEHO.js +0 -2
- package/chunks/block-JVJQU723.js +0 -1
- package/chunks/changelog-gen-ZCNNOY7G.js +0 -7
- package/chunks/chunk-2TRQKCFC.js +0 -1
- package/chunks/chunk-3TYZYY77.js +0 -1
- package/chunks/chunk-4HMEWMWL.js +0 -1
- package/chunks/chunk-5O7V5P53.js +0 -1
- package/chunks/chunk-5UGVJVIQ.js +0 -1
- package/chunks/chunk-6YRN6OJC.js +0 -2
- package/chunks/chunk-BKVQBSFV.js +0 -6
- package/chunks/chunk-CDLEA2PD.js +0 -1
- package/chunks/chunk-GRTR6TNJ.js +0 -1
- package/chunks/chunk-H2JGLZIR.js +0 -1
- package/chunks/chunk-HVMMNGY5.js +0 -7
- package/chunks/chunk-L2BYHWDC.js +0 -1
- package/chunks/chunk-LRL56YFE.js +0 -1
- package/chunks/chunk-LU3DHXOC.js +0 -2
- package/chunks/chunk-NADES3GN.js +0 -1
- package/chunks/chunk-QIUIPRJP.js +0 -1
- package/chunks/chunk-R6F4EK2B.js +0 -4
- package/chunks/chunk-RUZDG5PT.js +0 -60
- package/chunks/chunk-SCCNNGD4.js +0 -2
- package/chunks/chunk-SCULX2ND.js +0 -1
- package/chunks/chunk-VGFZXQMW.js +0 -1
- package/chunks/chunk-WE7PSSAQ.js +0 -91
- package/chunks/chunk-X4ZCYXOT.js +0 -1
- package/chunks/chunk-XMTGT2NJ.js +0 -10
- package/chunks/chunk-Y6DLCHJN.js +0 -1
- package/chunks/chunk-YUXQ7JNG.js +0 -1
- package/chunks/chunk-ZTLJ775S.js +0 -1
- package/chunks/claude-code-PWTLM554.js +0 -1
- package/chunks/clone-DASXIL35.js +0 -5
- package/chunks/file-tools-shared-ESMPLZVJ.js +0 -1
- package/chunks/gemini-I6F5N7PS.js +0 -1
- package/chunks/gh-Y4BXDXR5.js +0 -4
- package/chunks/init-GXBXQGGV.js +0 -1
- package/chunks/init-UFJL24PW.js +0 -12
- package/chunks/install-Q2KQZM62.js +0 -2
- package/chunks/kiro-NMTIFMT4.js +0 -1
- package/chunks/load-config-TSM3AAQ6.js +0 -1
- package/chunks/manifest-VJQJG2LS.js +0 -1
- package/chunks/mod-3PJAIZ2O.js +0 -1
- package/chunks/mod-FKPTF5D5.js +0 -1
- package/chunks/mod-GZ6BSK2P.js +0 -1
- package/chunks/mod-QODEWK3G.js +0 -9
- package/chunks/mod-S33TIBIC.js +0 -1
- package/chunks/mod-STKIZYZ3.js +0 -27
- package/chunks/new-W5YBJFGW.js +0 -4
- package/chunks/next-773GX25N.js +0 -3
- package/chunks/ollama-DQ5VM4HI.js +0 -1
- package/chunks/opencode-IZMQZ4ZK.js +0 -1
- package/chunks/recipe-applier-F2REROYS.js +0 -1
- package/chunks/registry-fetcher-ZJ76EHBA.js +0 -1
- package/chunks/release-notes-Z53AFCII.js +0 -3
- package/chunks/release-tag-QRIKYVQB.js +0 -1
- package/chunks/reset-5LQGIOGB.js +0 -1
- package/chunks/rule-K42YEAMO.js +0 -2
- package/chunks/spec-5446CSQC.js +0 -1
- package/chunks/status-HK3P6J6G.js +0 -1
- package/chunks/sync-4FSA5257.js +0 -1
- package/chunks/system-3MH6OCP6.js +0 -1
- package/chunks/system-DTVAUBIX.js +0 -1
- package/chunks/update-QD5S73WT.js +0 -5
- package/chunks/validate-bom-IVALGNGE.js +0 -1
- package/chunks/validate-case-conflict-LKECKLD5.js +0 -1
- package/chunks/validate-circular-deps-PXFPCBXA.js +0 -1
- package/chunks/validate-commit-msg-77CBKGOF.js +0 -1
- package/chunks/validate-docs-3UGB7LN7.js +0 -1
- package/chunks/validate-eof-ZSIYNHO5.js +0 -1
- package/chunks/validate-export-names-BPSCBX7B.js +0 -1
- package/chunks/validate-filenames-G4XJ2LHN.js +0 -1
- package/chunks/validate-json-YRCFW2O7.js +0 -1
- package/chunks/validate-large-files-MWWSFDOE.js +0 -1
- package/chunks/validate-licenses-Q2YA2MND.js +0 -1
- package/chunks/validate-line-endings-C6NHWHGI.js +0 -1
- package/chunks/validate-merge-conflict-KTBL4FUY.js +0 -1
- package/chunks/validate-mod-exports-LQIIQRIS.js +0 -1
- package/chunks/validate-package-configs-36PYXIWC.js +0 -1
- package/chunks/validate-secrets-UFDJ7ITY.js +0 -1
- package/chunks/validate-shebangs-3UO4MDMZ.js +0 -1
- package/chunks/validate-submodules-YA654D3B.js +0 -1
- package/chunks/validate-symlinks-R2PNE5TG.js +0 -1
- package/chunks/validate-toml-7H2N5AKI.js +0 -1
- package/chunks/validate-trailing-whitespace-HXO7M3ED.js +0 -1
- package/chunks/validate-yaml-ZJJCQVBB.js +0 -1
- package/chunks/versions-CWT5S7G4.js +0 -1
- package/chunks/vertexai-2SMP54AR.js +0 -1
- package/chunks/workerd-NXKZMQPV.js +0 -1
- /package/chunks/{chunk-QXTK62N4.js → chunk-ACQUINWH.js} +0 -0
- /package/chunks/{chunk-VTQ72OK7.js → chunk-FDZP7B5Y.js} +0 -0
- /package/chunks/{chunk-4OIKB2P5.js → chunk-T7K64JD5.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as K,b as j,c as M,d as F,f as N}from"./chunk-
|
|
1
|
+
import{a as K,b as j,c as M,d as F,f as N}from"./chunk-3OEM65F2.js";import{a as Q}from"./chunk-CKD2KOHA.js";import"./chunk-5RK3346P.js";import"./chunk-UKYKMDYU.js";import"./chunk-4H4O3TGK.js";import"./chunk-V2N5L24J.js";import"./chunk-Y6DZEK4W.js";import"./chunk-34GCQZ3Z.js";import"./chunk-3APERFKY.js";import{a as X}from"./chunk-ZF2XYULB.js";import"./chunk-GXPLME3K.js";import{b as Y}from"./chunk-2J2PXBOC.js";import{d as G,e as m,g as V}from"./chunk-OBIEQJDE.js";import{a as v}from"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import"./chunk-BCHXUKWW.js";import"./chunk-A2GDVOQP.js";import"./chunk-GLSCZGXA.js";import"./chunk-ZE5T64HQ.js";import{g as W,t as s}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var B=m.getLogger(["laroux-bundler","prebuilt-bundler"]),w=class{config;cachedManifest=null;constructor(e){this.config=e}async getBundle(){B.debug("\u{1F4E6} Loading prebuilt bundle from disk...");let e=s.path.resolve(this.config.distDir,"client","manifest.json"),t=await s.fs.readTextFile(e),r=JSON.parse(t),o=s.path.resolve(this.config.distDir,"client","module-map.json"),i={};try{let p=await s.fs.readTextFile(o);i=JSON.parse(p),B.debug(`\u2705 Loaded module map with ${Object.keys(i).length} entries`)}catch{B.warn("\u26A0\uFE0F Module map not found, SSR may fail for client components")}this.cachedManifest=r;let l=r.entrypoint?`/${r.entrypoint}`:"/client.js";return B.debug(`\u2705 Loaded manifest with entrypoint: ${l}`),{clientCode:null,moduleMap:i,chunkManifest:r,entrypoint:l}}async reload(){this.cachedManifest=null,await this.getBundle()}};var A=m.getLogger(["laroux-bundler","runtime-bundler"]),_=class{clientComponents=new Map;moduleMap=null;bundleCode=null;chunkManifest=null;lastScan=0;scanInterval=1e3;config;async getOrCreateBundle(){let e=Date.now();return(e-this.lastScan>this.scanInterval||!this.bundleCode)&&(await this.rebuild(),this.lastScan=e),{clientCode:this.bundleCode,moduleMap:this.moduleMap,clientComponents:this.clientComponents,chunkManifest:this.chunkManifest}}constructor(e){this.config=e}async rebuild(){let{plugin:e}=this.config,t=e.analyzeClientComponents?await e.analyzeClientComponents(this.config.srcDir,this.config.projectRoot):[];this.clientComponents.clear();for(let o of t)this.clientComponents.set(o.filePath,o);this.moduleMap=e.createModuleMap?await e.createModuleMap(t):{};let r=await this.bundleClientCode(t);this.bundleCode=r.code,this.chunkManifest=r.manifest}async bundleClientCode(e){let{plugin:t}=this.config,r=s.process.cwd(),o=await s.fs.makeTempDir({prefix:"rsc-runtime-",dir:r});try{if(!t.createClientEntry)throw new Error("Framework plugin does not provide createClientEntry");let i=await t.createClientEntry(e,r,o),l=K("deno-bundler",{entryName:"client"}),p={client:i};for(let g of e)p[g.relativePath]=g.filePath;let u={entrypoints:p,outputDir:o,format:"esm",platform:"browser",codeSplitting:j.codeSplitting,minify:j.minify,sourcemap:!1},a=await l.bundle(u);if(!a.success){let g=a.errors?.map(c=>c.message).join(", ")??"Unknown error";throw new Error(`Bundle failed: ${g}`)}let d=a.outputs.get("client.js");if(!d)throw new Error("Bundle output 'client.js' not found in bundle result");let f=new TextDecoder().decode(d.code),h={version:"1.0",buildId:"runtime",timestamp:Date.now(),logLevel:"debug",entrypoint:"__runtime_bundle.js",hmrEnabled:!0,chunks:{},files:{}};for(let g of e){let c=g.relativePath;h.chunks[c]={main:"__runtime_bundle",deps:[],size:0}}return{code:f,manifest:h}}catch(i){let l=i instanceof Error?i.message:String(i),p=i instanceof Error?i.stack:null;A.error("\u274C Runtime bundling failed:"),A.error(` Error: ${l}`),p!==null&&A.error(` Stack trace:
|
|
2
2
|
${p}`);let u=f=>f.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\n/g,"\\n").replace(/\r/g,"\\r"),a=`
|
|
3
3
|
console.error("Runtime bundling failed:", ${JSON.stringify(l)});
|
|
4
4
|
document.getElementById("root").innerHTML = '<div class="error"><h2>Bundle Error</h2><pre>${u(l)}</pre></div>';
|
|
5
|
-
`,d={version:"1.0",buildId:"runtime-error",timestamp:Date.now(),logLevel:"error",entrypoint:"__runtime_bundle.js",hmrEnabled:!1,chunks:{},files:{}};return{code:a,manifest:d}}finally{try{await s.fs.remove(o,{recursive:!0})}catch(i){A.debug("Temp directory cleanup failed",{error:i})}}}clear(){this.clientComponents.clear(),this.moduleMap=null,this.bundleCode=null,this.lastScan=0}};var D=class{cache;constructor(e){this.cache=new _(e)}async getBundle(){let e=await this.cache.getOrCreateBundle();return{clientCode:e.clientCode,moduleMap:e.moduleMap,chunkManifest:e.chunkManifest,entrypoint:"/__runtime_bundle.js"}}async getRuntimeBundle(){return await this.cache.getOrCreateBundle()}async rebuild(){await this.cache.rebuild()}clear(){this.cache.clear()}};var Z={name:"noop",renderPage:()=>Promise.resolve({html:""}),renderRSC:()=>Promise.resolve(new Response("")),generateBootstrapScript:()=>""};var ee={name:"noop",createShell:()=>"<!DOCTYPE html><html><head></head><body></body></html>",createStreamingStart:()=>"<!DOCTYPE html><html><head></head><body>",createStreamingEnd:()=>"</body></html>"};var b=m.getLogger(["laroux-server","hmr"]),$=class{clients=new Set;handleConnection(e){this.clients.add(e),b.debug(`HMR client connected (${this.clients.size} total)`),this.sendToClient(e,{type:"connected"}),e.addEventListener("close",()=>{this.clients.delete(e),b.debug(`HMR client disconnected (${this.clients.size} remaining)`)}),e.addEventListener("error",t=>{b.error("HMR WebSocket error:",{event:t}),this.clients.delete(e)})}notifyUpdate(e=Date.now(),t){let r={type:"update",timestamp:e,changedModules:t};b.debug(`Notifying ${this.clients.size} clients of update${t?` (${t.length} modules changed)`:""}`);for(let o of this.clients)this.sendToClient(o,r)}notifyError(e){let t={type:"error",message:e};b.warn(`Notifying clients of error: ${e}`);for(let r of this.clients)this.sendToClient(r,t)}sendToClient(e,t){if(e.readyState===WebSocket.OPEN)try{e.send(JSON.stringify(t))}catch(r){b.error("Failed to send HMR message:",{error:r})}}getClientCount(){return this.clients.size}close(){for(let e of this.clients)e.close();this.clients.clear()}};var L=m.getLogger(["laroux-server","api-handler"]);function ie(n){let e=new Set;return{pattern:n.replace(/\[\.\.\.(\w+)\]/g,(r,o)=>(e.add(o),`:${o}*`)).replace(/\[(\w+)\]/g,(r,o)=>`:${o}`),catchAllParams:e}}function se(n,e){let{pattern:t,catchAllParams:r}=ie(e),i=new URLPattern({pathname:t}).exec({pathname:n});if(!i)return null;let l={},p=i.pathname.groups;for(let[u,a]of Object.entries(p))r.has(u)?l[u]=a?a.split("/").filter(Boolean):[]:l[u]=a??"";return l}var H=class{routes=[];moduleCache=new Map;registryDir="";async loadRoutes(e){try{let t=`file://${e}/server/api-routes.ts`;this.registryDir=s.path.resolve(e,"server");let r=await import(t);this.routes=r.apiRoutes||[],L.debug(`Loaded ${this.routes.length} API route(s)`)}catch{this.routes=[],L.debug("No API routes registry found")}}async handleRequest(e,t){let r=new URL(e.url),o=e.method;for(let i of this.routes){let l=se(t,i.path);if(l!==null){L.debug(`API route matched: ${o} ${t} -> ${i.path}`);try{let p=s.path.resolve(this.registryDir,i.modulePath),u=this.moduleCache.get(p);u||(u=await import(`file://${p}`),this.moduleCache.set(p,u));let a=u[o];return a?await a({request:e,params:l,searchParams:r.searchParams}):(L.debug(`Method ${o} not allowed for ${i.path}`),new Response("Method Not Allowed",{status:405,headers:{Allow:this.getAllowedMethods(u).join(", ")}}))}catch(p){return L.error(`API route error: ${i.path}`,{error:p}),new Response(JSON.stringify({error:"Internal Server Error"}),{status:500,headers:{"Content-Type":"application/json"}})}}}return null}getAllowedMethods(e){let t=[];return e.GET&&t.push("GET"),e.POST&&t.push("POST"),e.PUT&&t.push("PUT"),e.DELETE&&t.push("DELETE"),e.PATCH&&t.push("PATCH"),e.HEAD&&t.push("HEAD"),e.OPTIONS&&t.push("OPTIONS"),t}clearCache(){this.moduleCache.clear()}};var P=m.getLogger(["laroux-server","proxy-handler"]),T=class{proxies=[];moduleCache=new Map;registryDir="";async loadProxies(e){try{let t=`file://${e}/server/proxy-registry.ts`;this.registryDir=s.path.resolve(e,"server");let r=await import(t);this.proxies=r.proxyRegistry||[],P.debug(`Loaded ${this.proxies.length} proxy definition(s)`)}catch{this.proxies=[],P.debug("No proxy registry found")}}async runProxies(e,t){let r=t;for(let o of this.proxies)if(this.matchesPrefix(r,o.pathPrefix)){P.debug(`Running proxy: ${o.pathPrefix} for ${r}`);try{let i=s.path.resolve(this.registryDir,o.modulePath),l=this.moduleCache.get(i);l||(l=await import(`file://${i}`),this.moduleCache.set(i,l));let p=l.default;if(typeof p!="function"){P.warn(`Proxy ${o.modulePath} does not export a default function`);continue}let u=await p({request:e,pathname:r,params:{}});if(u.type==="response")return P.debug(`Proxy ${o.pathPrefix} returned response`),{result:u,finalPathname:r};if(u.type==="redirect")return P.debug(`Proxy ${o.pathPrefix} redirecting to ${u.url}`),{result:u,finalPathname:r};u.type==="rewrite"&&(P.debug(`Proxy ${o.pathPrefix} rewriting to ${u.pathname}`),r=u.pathname)}catch(i){return P.error(`Proxy error: ${o.pathPrefix}`,{error:i}),{result:{type:"response",response:new Response(JSON.stringify({error:"Proxy Error"}),{status:500,headers:{"Content-Type":"application/json"}})},finalPathname:r}}}return{result:{type:"next"},finalPathname:r}}matchesPrefix(e,t){return t==="/"?!0:e===t||e.startsWith(t+"/")}clearCache(){this.moduleCache.clear()}};function te(n,e){let t=X(n,e.path);if(t===null)return null;let r={};for(let[o,i]of Object.entries(t))Array.isArray(i)?r[o]=[...i]:typeof i=="string"&&(r[o]=i);return r}function U(n,e){for(let t of e){let r=te(n,t);if(r!==null)return{route:t,params:r}}return null}var le=["trace","debug","info","warn","error","fatal"];var oe="manifest.json",ue=n=>({trace:v.Debug,debug:v.Debug,info:v.Info,warn:v.Warning,error:v.Error,fatal:v.Critical})[n],R,E;async function pe(n){let e=ue(n),{output:t,renderers:r,sinks:o}=await import("./mod-PEAFMI6F.js"),i=t({renderer:r.ansi(),sink:o.stdout()});await G.configure({sinks:{console:V.getOutputSink(i)},loggers:[{category:["laroux-server"],lowestLevel:e,sinks:["console"]},{category:["laroux-bundler"],lowestLevel:e,sinks:["console"]},{category:["laroux"],lowestLevel:e,sinks:["console"]}]}),R=m.getLogger(["laroux-server","server"]),E=m.getLogger(["laroux-server","bundler"])}var O=null;function ot(){O=null}async function ce(n){if(O!==null)return O;let t=`file://${s.path.join(n.distDir,"server","_generated-routes.ts")}?t=${Date.now()}`,{generatedRoutes:r}=await import(t);return O=r,r}async function re(n,e){let t=s.path.resolve(n.distDir,"server","src","app",`${e}.js`);if(await s.fs.exists(t))return t;for(let r of Y){let o=s.path.resolve(n.distDir,"server","src","app",`${e}.${r}`);if(await s.fs.exists(o))return o}return t}async function ne(n,e){let t=Date.now(),o=`file://${await re(e,"layout")}?t=${t}`,{Layout:i}=await import(o),l=await ce(e),p=U(n,l);if(p===null){let a=`file://${await re(e,"not-found")}?t=${t}`,{NotFound:d}=await import(a);return{Layout:i,Page:d,params:{}}}return{Layout:i,Page:p.route.component,params:p.params}}async function de(n){try{let e=s.path.resolve(n.distDir,"client",oe),t=await s.fs.readTextFile(e);return JSON.parse(t).buildId}catch{return"unknown"}}async function me(n){try{let e=s.path.resolve(n.distDir,"client",oe),t=await s.fs.stat(e),r=await s.fs.stat(n.srcDir);return t.mtime===null||r.mtime===null?!1:t.mtime>r.mtime}catch{return!1}}function I(n){return{projectRoot:n.projectRoot,srcDir:n.srcDir,distDir:n.distDir,logLevel:n.logLevel,fonts:n.fonts,images:n.images,cssModuleTypes:n.cssModuleTypes,noCssModuleAutoReference:n.noCssModuleAutoReference,browserShims:n.browserShims,serverExternals:n.build.serverExternals}}async function ge(n,e={}){let{config:t,bundler:r,hmrManager:o}=n,{frameworkPlugin:i,cssPlugin:l}=e;try{let c=s.path.resolve(t.distDir,"server","actions-manifest.json");if(await s.fs.exists(c)){let x=await s.fs.readTextFile(c),z=JSON.parse(x),q=Date.now(),C=0;for(let J of z.actions)try{let k=s.path.resolve(t.distDir,"server",J);await s.fs.exists(k)&&(await import(`file://${k}?t=${q}`),C++)}catch(k){R.warn(`Failed to load action ${J}:`,{error:k})}C>0&&R.debug(`Server actions loaded: ${C} file(s)`)}else R.debug("No actions manifest found (optional)")}catch(c){R.warn("Failed to load server actions:",{error:c})}await ne("/",t);let p=await de(t);E.debug(`Build ID: ${p}`);let a={...n,getApp:c=>ne(c,t),buildId:p},d=await r.getBundle(),f={framework:i,css:l,bundlerBackend:"deno-bundler"};if(d.clientCode!==null&&o!==null){if(i!==void 0){let c=M(I(t),f);N(c,async y=>{if(r instanceof D)try{await r.rebuild()}catch(x){E.error("Compilation failed:",{error:x})}E.info(`\u2713 Compiled in ${y.duration.toFixed(0)}ms`),o?.notifyUpdate(Date.now(),y.changedFiles)})}}else if(t.mode.isWatch&&i!==void 0){let c=M(I(t),f);N(c,y=>{E.info(`\u2713 Compiled in ${y.duration.toFixed(0)}ms`)})}let h="";d.clientCode!==null&&o!==null?h=" HMR":d.clientCode!==null&&(h=" Watch"),R.info(`RSC Server${h}`),R.info(` Local: http://localhost:${t.server.port}`);let{startHTTPServer:g}=await import("./server-PXE4DB3V.js");return g(a),a}async function it(n){let e=n.projectRoot??s.process.cwd(),t=n.logLevel??"info",r=n.mode==="dev",{renderer:o,htmlShell:i,frameworkPlugin:l,cssPlugin:p}=n;await pe(t);let u=await Q(e),a={...u,srcDir:s.path.resolve(e,u.srcDir),distDir:s.path.resolve(e,u.distDir),publicDir:s.path.resolve(e,u.publicDir),logLevel:t,mode:{isDev:r,isBuild:!1,isServe:!r,isWatch:r}};n.port!==void 0&&(a.server.port=n.port),n.hmr!==void 0?a.server.hmr=n.hmr:r&&(a.server.hmr=!0),n.open!==void 0&&(a.server.open=n.open),r&&(a.build.minify=!1);let d=await me(a),f=r||!d,h={framework:l,css:p};if(f&&r&&l!==void 0){let C=M(I(a),{...h,bundlerBackend:"deno-bundler"});await F(C)}else if(f&&l!==void 0){let C=M(I(a),{...h,bundlerBackend:"rolldown"});await F(C)}let g,c=null;r&&a.server.hmr?(c=new $,g=new w({distDir:a.distDir})):g=new w({distDir:a.distDir});let y=new H;await y.loadRoutes(a.distDir);let x=new T;await x.loadProxies(a.distDir),await ge({config:a,bundler:g,hmrManager:c,apiHandler:y,middlewareDispatcher:x,renderer:o??Z,htmlShell:i??ee},{frameworkPlugin:l,cssPlugin:p}),n.open&&fe(`http://localhost:${a.server.port}`)}function fe(n){let e={darwin:["open"],linux:["xdg-open"],windows:["cmd","/c","start"]},t=W(),r=e[t];r&&r[0]&&s.exec.spawnChild(r[0],[...r.slice(1),n],{stdout:"null",stderr:"null"})}export{le as VALID_LOG_LEVELS,ot as clearRoutesCache,it as startServer};
|
|
5
|
+
`,d={version:"1.0",buildId:"runtime-error",timestamp:Date.now(),logLevel:"error",entrypoint:"__runtime_bundle.js",hmrEnabled:!1,chunks:{},files:{}};return{code:a,manifest:d}}finally{try{await s.fs.remove(o,{recursive:!0})}catch(i){A.debug("Temp directory cleanup failed",{error:i})}}}clear(){this.clientComponents.clear(),this.moduleMap=null,this.bundleCode=null,this.lastScan=0}};var D=class{cache;constructor(e){this.cache=new _(e)}async getBundle(){let e=await this.cache.getOrCreateBundle();return{clientCode:e.clientCode,moduleMap:e.moduleMap,chunkManifest:e.chunkManifest,entrypoint:"/__runtime_bundle.js"}}async getRuntimeBundle(){return await this.cache.getOrCreateBundle()}async rebuild(){await this.cache.rebuild()}clear(){this.cache.clear()}};var Z={name:"noop",renderPage:()=>Promise.resolve({html:""}),renderRSC:()=>Promise.resolve(new Response("")),generateBootstrapScript:()=>""};var ee={name:"noop",createShell:()=>"<!DOCTYPE html><html><head></head><body></body></html>",createStreamingStart:()=>"<!DOCTYPE html><html><head></head><body>",createStreamingEnd:()=>"</body></html>"};var b=m.getLogger(["laroux-server","hmr"]),$=class{clients=new Set;handleConnection(e){this.clients.add(e),b.debug(`HMR client connected (${this.clients.size} total)`),this.sendToClient(e,{type:"connected"}),e.addEventListener("close",()=>{this.clients.delete(e),b.debug(`HMR client disconnected (${this.clients.size} remaining)`)}),e.addEventListener("error",t=>{b.error("HMR WebSocket error:",{event:t}),this.clients.delete(e)})}notifyUpdate(e=Date.now(),t){let r={type:"update",timestamp:e,changedModules:t};b.debug(`Notifying ${this.clients.size} clients of update${t?` (${t.length} modules changed)`:""}`);for(let o of this.clients)this.sendToClient(o,r)}notifyError(e){let t={type:"error",message:e};b.warn(`Notifying clients of error: ${e}`);for(let r of this.clients)this.sendToClient(r,t)}sendToClient(e,t){if(e.readyState===WebSocket.OPEN)try{e.send(JSON.stringify(t))}catch(r){b.error("Failed to send HMR message:",{error:r})}}getClientCount(){return this.clients.size}close(){for(let e of this.clients)e.close();this.clients.clear()}};var L=m.getLogger(["laroux-server","api-handler"]);function ie(n){let e=new Set;return{pattern:n.replace(/\[\.\.\.(\w+)\]/g,(r,o)=>(e.add(o),`:${o}*`)).replace(/\[(\w+)\]/g,(r,o)=>`:${o}`),catchAllParams:e}}function se(n,e){let{pattern:t,catchAllParams:r}=ie(e),i=new URLPattern({pathname:t}).exec({pathname:n});if(!i)return null;let l={},p=i.pathname.groups;for(let[u,a]of Object.entries(p))r.has(u)?l[u]=a?a.split("/").filter(Boolean):[]:l[u]=a??"";return l}var H=class{routes=[];moduleCache=new Map;registryDir="";async loadRoutes(e){try{let t=`file://${e}/server/api-routes.ts`;this.registryDir=s.path.resolve(e,"server");let r=await import(t);this.routes=r.apiRoutes||[],L.debug(`Loaded ${this.routes.length} API route(s)`)}catch{this.routes=[],L.debug("No API routes registry found")}}async handleRequest(e,t){let r=new URL(e.url),o=e.method;for(let i of this.routes){let l=se(t,i.path);if(l!==null){L.debug(`API route matched: ${o} ${t} -> ${i.path}`);try{let p=s.path.resolve(this.registryDir,i.modulePath),u=this.moduleCache.get(p);u||(u=await import(`file://${p}`),this.moduleCache.set(p,u));let a=u[o];return a?await a({request:e,params:l,searchParams:r.searchParams}):(L.debug(`Method ${o} not allowed for ${i.path}`),new Response("Method Not Allowed",{status:405,headers:{Allow:this.getAllowedMethods(u).join(", ")}}))}catch(p){return L.error(`API route error: ${i.path}`,{error:p}),new Response(JSON.stringify({error:"Internal Server Error"}),{status:500,headers:{"Content-Type":"application/json"}})}}}return null}getAllowedMethods(e){let t=[];return e.GET&&t.push("GET"),e.POST&&t.push("POST"),e.PUT&&t.push("PUT"),e.DELETE&&t.push("DELETE"),e.PATCH&&t.push("PATCH"),e.HEAD&&t.push("HEAD"),e.OPTIONS&&t.push("OPTIONS"),t}clearCache(){this.moduleCache.clear()}};var P=m.getLogger(["laroux-server","proxy-handler"]),T=class{proxies=[];moduleCache=new Map;registryDir="";async loadProxies(e){try{let t=`file://${e}/server/proxy-registry.ts`;this.registryDir=s.path.resolve(e,"server");let r=await import(t);this.proxies=r.proxyRegistry||[],P.debug(`Loaded ${this.proxies.length} proxy definition(s)`)}catch{this.proxies=[],P.debug("No proxy registry found")}}async runProxies(e,t){let r=t;for(let o of this.proxies)if(this.matchesPrefix(r,o.pathPrefix)){P.debug(`Running proxy: ${o.pathPrefix} for ${r}`);try{let i=s.path.resolve(this.registryDir,o.modulePath),l=this.moduleCache.get(i);l||(l=await import(`file://${i}`),this.moduleCache.set(i,l));let p=l.default;if(typeof p!="function"){P.warn(`Proxy ${o.modulePath} does not export a default function`);continue}let u=await p({request:e,pathname:r,params:{}});if(u.type==="response")return P.debug(`Proxy ${o.pathPrefix} returned response`),{result:u,finalPathname:r};if(u.type==="redirect")return P.debug(`Proxy ${o.pathPrefix} redirecting to ${u.url}`),{result:u,finalPathname:r};u.type==="rewrite"&&(P.debug(`Proxy ${o.pathPrefix} rewriting to ${u.pathname}`),r=u.pathname)}catch(i){return P.error(`Proxy error: ${o.pathPrefix}`,{error:i}),{result:{type:"response",response:new Response(JSON.stringify({error:"Proxy Error"}),{status:500,headers:{"Content-Type":"application/json"}})},finalPathname:r}}}return{result:{type:"next"},finalPathname:r}}matchesPrefix(e,t){return t==="/"?!0:e===t||e.startsWith(t+"/")}clearCache(){this.moduleCache.clear()}};function te(n,e){let t=X(n,e.path);if(t===null)return null;let r={};for(let[o,i]of Object.entries(t))Array.isArray(i)?r[o]=[...i]:typeof i=="string"&&(r[o]=i);return r}function U(n,e){for(let t of e){let r=te(n,t);if(r!==null)return{route:t,params:r}}return null}var le=["trace","debug","info","warn","error","fatal"];var oe="manifest.json",ue=n=>({trace:v.Debug,debug:v.Debug,info:v.Info,warn:v.Warning,error:v.Error,fatal:v.Critical})[n],R,E;async function pe(n){let e=ue(n),{output:t,renderers:r,sinks:o}=await import("./mod-CUIGNRIK.js"),i=t({renderer:r.ansi(),sink:o.stdout()});await G.configure({sinks:{console:V.getOutputSink(i)},loggers:[{category:["laroux-server"],lowestLevel:e,sinks:["console"]},{category:["laroux-bundler"],lowestLevel:e,sinks:["console"]},{category:["laroux"],lowestLevel:e,sinks:["console"]}]}),R=m.getLogger(["laroux-server","server"]),E=m.getLogger(["laroux-server","bundler"])}var O=null;function ot(){O=null}async function ce(n){if(O!==null)return O;let t=`file://${s.path.join(n.distDir,"server","_generated-routes.ts")}?t=${Date.now()}`,{generatedRoutes:r}=await import(t);return O=r,r}async function re(n,e){let t=s.path.resolve(n.distDir,"server","src","app",`${e}.js`);if(await s.fs.exists(t))return t;for(let r of Y){let o=s.path.resolve(n.distDir,"server","src","app",`${e}.${r}`);if(await s.fs.exists(o))return o}return t}async function ne(n,e){let t=Date.now(),o=`file://${await re(e,"layout")}?t=${t}`,{Layout:i}=await import(o),l=await ce(e),p=U(n,l);if(p===null){let a=`file://${await re(e,"not-found")}?t=${t}`,{NotFound:d}=await import(a);return{Layout:i,Page:d,params:{}}}return{Layout:i,Page:p.route.component,params:p.params}}async function de(n){try{let e=s.path.resolve(n.distDir,"client",oe),t=await s.fs.readTextFile(e);return JSON.parse(t).buildId}catch{return"unknown"}}async function me(n){try{let e=s.path.resolve(n.distDir,"client",oe),t=await s.fs.stat(e),r=await s.fs.stat(n.srcDir);return t.mtime===null||r.mtime===null?!1:t.mtime>r.mtime}catch{return!1}}function I(n){return{projectRoot:n.projectRoot,srcDir:n.srcDir,distDir:n.distDir,logLevel:n.logLevel,fonts:n.fonts,images:n.images,cssModuleTypes:n.cssModuleTypes,noCssModuleAutoReference:n.noCssModuleAutoReference,browserShims:n.browserShims,serverExternals:n.build.serverExternals}}async function ge(n,e={}){let{config:t,bundler:r,hmrManager:o}=n,{frameworkPlugin:i,cssPlugin:l}=e;try{let c=s.path.resolve(t.distDir,"server","actions-manifest.json");if(await s.fs.exists(c)){let x=await s.fs.readTextFile(c),z=JSON.parse(x),q=Date.now(),C=0;for(let J of z.actions)try{let k=s.path.resolve(t.distDir,"server",J);await s.fs.exists(k)&&(await import(`file://${k}?t=${q}`),C++)}catch(k){R.warn(`Failed to load action ${J}:`,{error:k})}C>0&&R.debug(`Server actions loaded: ${C} file(s)`)}else R.debug("No actions manifest found (optional)")}catch(c){R.warn("Failed to load server actions:",{error:c})}await ne("/",t);let p=await de(t);E.debug(`Build ID: ${p}`);let a={...n,getApp:c=>ne(c,t),buildId:p},d=await r.getBundle(),f={framework:i,css:l,bundlerBackend:"deno-bundler"};if(d.clientCode!==null&&o!==null){if(i!==void 0){let c=M(I(t),f);N(c,async y=>{if(r instanceof D)try{await r.rebuild()}catch(x){E.error("Compilation failed:",{error:x})}E.info(`\u2713 Compiled in ${y.duration.toFixed(0)}ms`),o?.notifyUpdate(Date.now(),y.changedFiles)})}}else if(t.mode.isWatch&&i!==void 0){let c=M(I(t),f);N(c,y=>{E.info(`\u2713 Compiled in ${y.duration.toFixed(0)}ms`)})}let h="";d.clientCode!==null&&o!==null?h=" HMR":d.clientCode!==null&&(h=" Watch"),R.info(`RSC Server${h}`),R.info(` Local: http://localhost:${t.server.port}`);let{startHTTPServer:g}=await import("./server-RYWDAYED.js");return g(a),a}async function it(n){let e=n.projectRoot??s.process.cwd(),t=n.logLevel??"info",r=n.mode==="dev",{renderer:o,htmlShell:i,frameworkPlugin:l,cssPlugin:p}=n;await pe(t);let u=await Q(e),a={...u,srcDir:s.path.resolve(e,u.srcDir),distDir:s.path.resolve(e,u.distDir),publicDir:s.path.resolve(e,u.publicDir),logLevel:t,mode:{isDev:r,isBuild:!1,isServe:!r,isWatch:r}};n.port!==void 0&&(a.server.port=n.port),n.hmr!==void 0?a.server.hmr=n.hmr:r&&(a.server.hmr=!0),n.open!==void 0&&(a.server.open=n.open),r&&(a.build.minify=!1);let d=await me(a),f=r||!d,h={framework:l,css:p};if(f&&r&&l!==void 0){let C=M(I(a),{...h,bundlerBackend:"deno-bundler"});await F(C)}else if(f&&l!==void 0){let C=M(I(a),{...h,bundlerBackend:"rolldown"});await F(C)}let g,c=null;r&&a.server.hmr?(c=new $,g=new w({distDir:a.distDir})):g=new w({distDir:a.distDir});let y=new H;await y.loadRoutes(a.distDir);let x=new T;await x.loadProxies(a.distDir),await ge({config:a,bundler:g,hmrManager:c,apiHandler:y,middlewareDispatcher:x,renderer:o??Z,htmlShell:i??ee},{frameworkPlugin:l,cssPlugin:p}),n.open&&fe(`http://localhost:${a.server.port}`)}function fe(n){let e={darwin:["open"],linux:["xdg-open"],windows:["cmd","/c","start"]},t=W(),r=e[t];r&&r[0]&&s.exec.spawnChild(r[0],[...r.slice(1),n],{stdout:"null",stderr:"null"})}export{le as VALID_LOG_LEVELS,ot as clearRoutesCache,it as startServer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c}from"./chunk-3I4JG3PJ.js";import"./chunk-GXPLME3K.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{a as MANIFEST_FILENAMES,c as getManifestPath,b as loadManifest};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as G,b as v}from"./chunk-TXL6YOFL.js";import{a as P,b as g}from"./chunk-GETSWLMF.js";import{a as S,b as J}from"./chunk-3EFU5R2M.js";import{a as K,b as V}from"./chunk-U47ABJCC.js";import{a as h,b as O,c as k,d as R,e as B,f as E}from"./chunk-762C2IM6.js";import"./chunk-5MN3MWQN.js";import{a as f,b as u}from"./chunk-BDTJR6UH.js";import{a as A,b as C}from"./chunk-QIYWONJL.js";import{a as M,b as w}from"./chunk-AAV7D6DF.js";import{a as I,b as T}from"./chunk-QIODVVTY.js";import{a as l,b as m,c as s,d,e as y,f as F,g as x}from"./chunk-3K42AALS.js";import"./chunk-OLM5RTFK.js";import"./chunk-BCHXUKWW.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var o=null,b=async()=>{if(o!==null)return o;let{anthropicFactory:e}=await import("./anthropic-SL274RBQ.js"),{openaiFactory:r}=await import("./openai-XMIVMDDL.js"),{geminiFactory:t}=await import("./gemini-ARTUPDPZ.js"),{vertexaiFactory:a}=await import("./vertexai-TPGIAJNA.js"),{claudeCodeFactory:i}=await import("./claude-code-K37KYX7W.js"),{ollamaFactory:c}=await import("./ollama-6JZ2IKR7.js"),{openCodeFactory:n}=await import("./opencode-CHIAJALZ.js"),{kiroFactory:p}=await import("./kiro-XQDHURLU.js");return o=[e,r,t,a,i,c,n,p],o};export{G as AnthropicModel,f as ClaudeCodeModel,S as GeminiModel,I as KiroModel,A as OllamaModel,P as OpenAIModel,M as OpenCodeModel,K as VertexAIModel,v as anthropicFactory,y as captureStderr,F as classifyExitCode,E as classifyGenAIError,u as claudeCodeFactory,b as defaultFactories,x as formatMessagesAsText,J as geminiFactory,T as kiroFactory,O as mapContentBlockToGenAIPart,B as mapGenAIResponseToResult,k as mapMessagesToGenAI,h as mapRoleToGenAI,R as mapToolsToGenAI,C as ollamaFactory,w as openCodeFactory,g as openaiFactory,s as parseJsonlStream,d as parseTextOutput,l as resolveBinary,m as spawnCliProcess,V as vertexaiFactory};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f as g,g as h,h as i,i as j,j as k,k as l}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f as g,g as h,h as i,i as j,j as k,k as l}from"./chunk-TTYO2XJO.js";import{n as f}from"./chunk-PLJNPQFC.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{b as PipelineError,a as StreamError,c as TimeoutError,d as createChunk,e as defineLayer,k as layers,g as output,h as pipeline,l as renderers,i as sinks,j as sources,f as span};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{a as _}from"./chunk-GXPLME3K.js";import{d as L}from"./chunk-2J2PXBOC.js";import{f as U,h as H,k as G}from"./chunk-TTYO2XJO.js";import{b as w,d as S,e as C,f as O,j as z}from"./chunk-PLJNPQFC.js";import{b as N}from"./chunk-BCHXUKWW.js";import{a as q}from"./chunk-HPPFA3XU.js";import{a as E,b as $,d as V,f as D}from"./chunk-DQAEQEXD.js";import{t as l}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import{b as v}from"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var x=class extends TransformStream{constructor(t){let e;super({transform(s,a){if(e!==void 0){let n=new Uint8Array(e.length+s.length);n.set(e),n.set(s,e.length),s=n}for(let n=t;n<=s.length;n+=t)a.enqueue(s.slice(n-t,n));let f=-s.length%t;e=f?s.slice(f):void 0},flush(s){e?.length&&s.enqueue(e)}})}};var P=class{#s;#n;#t;#e=[];#r=!1;constructor(){let{readable:t,writable:e}=new TransformStream;this.#s=ReadableStream.from(this.#i()),this.#n=e,this.#t=t.pipeThrough(new x(512)).getReader()}async#a(){let{done:t,value:e}=await this.#t.read();if(!t){if(e.length!==512)throw new RangeError(`Cannot extract the tar archive: The tarball chunk has an unexpected number of bytes (${e.length})`);return this.#e.push(e),this.#e.shift()}}async*#i(){for(let e=0;e<2;++e){let{done:s,value:a}=await this.#t.read();if(s||a.length!==512)throw new RangeError("Cannot extract the tar archive: The tarball is too small to be valid");this.#e.push(a)}let t=new TextDecoder;for(;;){for(;this.#r;)await new Promise(n=>setTimeout(n,0));if(this.#e.every(n=>n.every(o=>o===0))){await this.#t.cancel("Tar stream finished prematurely");return}let e=await this.#a();if(e==null){if(this.#e.every(n=>n.every(o=>o===0)))break;throw new TypeError("Cannot extract the tar archive: The tarball has invalid ending")}let s=parseInt(t.decode(e.subarray(148,156)),8);if(e.fill(32,148,156),e.reduce((n,o)=>n+o)!==s)throw new SyntaxError("Cannot extract the tar archive: An archive entry has invalid header checksum");let a={name:t.decode(e.subarray(0,100)).split("\0")[0],mode:parseInt(t.decode(e.subarray(100,108)),8),uid:parseInt(t.decode(e.subarray(108,116)),8),gid:parseInt(t.decode(e.subarray(116,124)),8),size:parseInt(t.decode(e.subarray(124,136)).trimEnd(),8),mtime:parseInt(t.decode(e.subarray(136,147)),8),typeflag:t.decode(e.subarray(156,157)),linkname:t.decode(e.subarray(157,257)).split("\0")[0]};a.typeflag==="\0"&&(a.typeflag="0"),[117,115,116,97,114,0,48,48].every((n,o)=>e[o+257]===n)&&(a={...a,magic:t.decode(e.subarray(257,263)),version:t.decode(e.subarray(263,265)),uname:t.decode(e.subarray(265,297)).split("\0")[0],gname:t.decode(e.subarray(297,329)).split("\0")[0],devmajor:t.decode(e.subarray(329,337)).replaceAll("\0",""),devminor:t.decode(e.subarray(337,345)).replaceAll("\0",""),prefix:t.decode(e.subarray(345,500)).split("\0")[0]});let f={path:("prefix"in a&&a.prefix.length?a.prefix+"/":"")+a.name,header:a};["1","2","3","4","5","6"].includes(a.typeflag)||(f.readable=this.#l(a.size)),yield f}}async*#o(t){for(let e=Math.ceil(t/512);e>0;--e){let s=await this.#a();if(s==null)throw new SyntaxError("Cannot extract the tar archive: Unexpected end of Tarball");e===1&&t%512?yield s.subarray(0,t%512):yield s}}#l(t){this.#r=!0;let e=()=>this.#r=!1,s=this.#o(t);return new ReadableStream({type:"bytes",async pull(a){let{done:f,value:n}=await s.next();if(f)return e(),a.close(),a.byobRequest?.respond(0);if(a.byobRequest?.view){let o=new Uint8Array(a.byobRequest.view.buffer),i=o.length;i<n.length?(o.set(n.slice(0,i)),a.byobRequest.respond(i),a.enqueue(n.slice(i))):(o.set(n),a.byobRequest.respond(n.length))}else a.enqueue(n)},async cancel(){for await(let a of s);e()}})}get readable(){return this.#s}get writable(){return this.#n}};var M=async(r,t,e={})=>{let{stripComponents:s=0,subpath:a}=e,f=a!==void 0?l.path.normalize(a).replace(/^\/+/,""):void 0,o=r.pipeThrough(new DecompressionStream("gzip")).pipeThrough(new P);for await(let i of o){let c=l.path.normalize(i.path);if(c.startsWith("..")||l.path.isAbsolute(c)){i.readable!==void 0&&await i.readable.cancel();continue}let u=c.split(l.path.sep).slice(s);if(u.length===0){i.readable!==void 0&&await i.readable.cancel();continue}let d=u.join(l.path.sep);if(f!==void 0){if(!d.startsWith(f)){i.readable!==void 0&&await i.readable.cancel();continue}if(d.slice(f.length).replace(/^\/+/,"")===""){i.readable!==void 0&&await i.readable.cancel();continue}}let h=f!==void 0?l.path.join(t,d.slice(f.length).replace(/^\/+/,"")):l.path.join(t,d);if(await l.fs.ensureDir(l.path.dirname(h)),i.readable!==void 0){let b=new Response(i.readable),m=new Uint8Array(await b.arrayBuffer());await l.fs.writeFile(h,m)}}};var re="main",se=r=>{let[t,e]=r.split("#");if(t===void 0)throw new Error(`Invalid GitHub specifier: ${r}`);let s=t.split("/");if(s.length<2)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);let[a,f,...n]=s;if(a===void 0||f===void 0)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);return{provider:"github",raw:r,owner:a,repo:f,ref:e??re,path:n.length>0?n.join("/"):void 0}},ne=async(r,t)=>{let e=r,{owner:s,repo:a,ref:f,path:n}=e,o=`https://codeload.github.com/${s}/${a}/tar.gz/${f}`,i=await fetch(o);if(!i.ok)throw i.status===404?new Error(`Repository not found: ${s}/${a} (ref: ${f})`):new Error(`Failed to fetch template: ${i.status} ${i.statusText}`);if(i.body===null)throw new Error("Response body is empty");await M(i.body,t,{stripComponents:1,subpath:n})},W={name:"github",prefixes:["github","gh"],isDefault:!0,parse:se,fetch:ne};var g={providers:new Map,defaultProvider:null,initialized:!1},A=()=>{g.initialized||(g.initialized=!0,B(W))},B=r=>{g.providers.set(r.name,r);for(let t of r.prefixes)g.providers.set(t,r);r.isDefault===!0&&(g.defaultProvider=r)},ae=r=>(A(),g.providers.get(r)??null),ie=()=>(A(),g.defaultProvider),X=r=>{A();let t=r.indexOf(":");if(t!==-1){let e=r.slice(0,t),s=r.slice(t+1),a=g.providers.get(e);if(a===void 0)throw new Error(`Unknown provider prefix: ${e}`);return{provider:a,ref:a.parse(s)}}if(g.defaultProvider===null)throw new Error("No default provider registered");return{provider:g.defaultProvider,ref:g.defaultProvider.parse(r)}},I=async(r,t)=>{let{provider:e,ref:s}=X(r);return await e.fetch(s,t),s};var J=[".manifest.yml",".manifest.yaml"],j=async r=>{for(let t of J){let e=l.path.join(r,t);try{let s=await l.fs.readTextFile(e),a=_(s);if(typeof a.name!="string"||a.name==="")throw new Error(`Template config missing required 'name' field: ${e}`);return a}catch(s){if(s instanceof v)continue;throw s}}return null},oe=r=>{let t=r.description??r.name,e=r.default!==void 0?` [${r.default}]`:"",s=r.required===!0?" (required)":"",a=`${t}${s}${e}: `,f=globalThis.prompt(a);return f===null||f===""?r.default??null:f},Y=(r,t)=>r.pattern===void 0||new RegExp(r.pattern).test(t)?null:`Value '${t}' does not match pattern '${r.pattern}'`,F=(r,t)=>{let{provided:e,interactive:s}=t,a=r.variables??[],f={...e},n=[];for(let o of a){let{name:i,required:c,default:p}=o;if(f[i]!==void 0){let u=Y(o,f[i]);u!==null&&n.push(`${i}: ${u}`);continue}if(s){let u=oe(o);if(u!==null){let d=Y(o,u);d!==null?n.push(`${i}: ${d}`):f[i]=u;continue}}if(p!==void 0){f[i]=p;continue}c===!0&&n.push(`Missing required variable: ${i}`)}if(n.length>0)throw new Error(`Variable resolution failed:
|
|
2
|
+
${n.join(`
|
|
3
|
+
`)}`);return f},K=async r=>{for(let t of J){let e=l.path.join(r,t);try{return await l.fs.stat(e),e}catch{continue}}return null};var Q=/\{\{\s*\.(\w+)\s*\}\}/g,le=["png","jpg","jpeg","gif","ico","webp","svg","woff","woff2","ttf","eot","otf","zip","tar","gz","bz2","xz","7z","pdf","doc","docx","xls","xlsx","ppt","pptx","exe","dll","so","dylib","mp3","mp4","avi","mov","webm"],fe=r=>L(r.toLowerCase(),le),ce=(r,t)=>{for(let e of t)if(e.startsWith("*")){let s=e.slice(1);if(r.endsWith(s))return!0}else if(e.includes("*")){let s=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");if(new RegExp(`^${s}$`).test(r))return!0}else if(r===e||r.startsWith(e+"/"))return!0;return!1},T=(r,t)=>r.replace(Q,(e,s)=>{let a=t[s];return a===void 0?`{{.${s}}}`:a}),R=r=>Q.test(r),Z=async(r,t)=>{let{variables:e,ignore:s}=t,a=[],f=[];for await(let n of l.fs.walk(r,{includeDirs:!0})){let o=l.path.relative(r,n.path);o!==""&&(ce(o,s)||(n.isDirectory?R(n.name)&&f.push(n.path):n.isFile&&a.push(n.path)))}for(let n of a){let o=l.path.basename(n),i=l.path.dirname(n);if(!fe(n))try{let c=await l.fs.readTextFile(n);if(R(c)){let p=T(c,e);await l.fs.writeTextFile(n,p)}}catch(c){if(!(c instanceof Error&&c.name==="InvalidData"))throw c}if(R(o)){let c=T(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}}f.sort((n,o)=>o.split(l.path.sep).length-n.split(l.path.sep).length);for(let n of f){let o=l.path.basename(n),i=l.path.dirname(n),c=T(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}},ee=async r=>{try{await l.fs.remove(r)}catch(t){if(!(t instanceof v))throw t}};var k=async r=>{let{specifier:t,targetDir:e,variables:s={},force:a=!1,skipPostInstall:f=!1,interactive:n=!1}=r,o=l.path.isAbsolute(e)?e:l.path.join(l.process.cwd(),e);try{let m=[];for await(let y of l.fs.readDir(o)){m.push(y);break}if(m.length>0&&!a)throw new Error(`Target directory is not empty: ${o}. Use --force to overwrite.`)}catch(m){if(!(m instanceof v))throw m}await l.fs.ensureDir(o),await I(t,o);let i=await j(o),c=i?.name??t,p=i!==null?F(i,{provided:s,interactive:n}):s,u=[".git",".manifest.yml",".manifest.yaml",...i?.ignore??[]];await Z(o,{variables:p,ignore:u});let d=await K(o);d!==null&&await ee(d);let h=i?.postInstall??[],b=[];if(!f&&h.length>0)for(let m of h)try{(await N`${m}`.cwd(o).stdout("inherit").stderr("inherit").noThrow().spawn()).success?b.push(m):console.warn(`Post-install command failed: ${m}`)}catch(y){console.warn(`Post-install command error: ${m}`,y)}return{templateName:c,targetDir:o,variables:p,postInstallCommands:b}};var ze=async r=>{let t=q(r??l.process.args,{string:["path","var"],boolean:["force","interactive","skip-post-install","help"],alias:{p:"path",f:"force",i:"interactive",h:"help"},collect:["var"]});if(t.help)return console.log(`Usage: scaffold <specifier> [options]
|
|
4
|
+
|
|
5
|
+
Options:
|
|
6
|
+
-p, --path <dir> Target directory (default: .)
|
|
7
|
+
-f, --force Overwrite existing files
|
|
8
|
+
-i, --interactive Prompt for missing variables
|
|
9
|
+
--var key=value Set a template variable (repeatable)
|
|
10
|
+
--skip-post-install Skip post-install commands
|
|
11
|
+
-h, --help Show this help message
|
|
12
|
+
|
|
13
|
+
Examples:
|
|
14
|
+
scaffold eser/ajan
|
|
15
|
+
scaffold gh:eser/ajan#v1.0 -p ./my-project
|
|
16
|
+
scaffold eser/ajan --var name=my-app --var author=me`),E(void 0);let e=G.ansi(),s=U({renderer:e,sink:H.stdout()});if(t._.length===0)return await s.close(),$({message:`${e.render([C("Error: Template specifier is required")])}
|
|
17
|
+
|
|
18
|
+
Usage: scaffold <specifier> [options]
|
|
19
|
+
|
|
20
|
+
Examples:
|
|
21
|
+
scaffold eser/ajan
|
|
22
|
+
scaffold gh:eser/ajan#v1.0
|
|
23
|
+
scaffold eser/ajan -p ./my-project`,exitCode:1});let a=String(t._[0]),f=t.path??".",n=t.force??!1,o=t["skip-post-install"]??!1,i=t.interactive??!1,c=t.var,p={};if(c!==void 0)for(let h of c){let[b,...m]=String(h).split("=");b!==void 0&&(p[b]=m.join("="))}s.writeln(w("Scaffolding from "),z(a),w("..."));let u=await D(()=>k({specifier:a,targetDir:f,variables:p,force:n,skipPostInstall:o,interactive:i}),h=>({message:h.message}));if(V(u))return await s.close(),$({message:e.render([C(`
|
|
24
|
+
Scaffolding failed: ${u.error.message}`)]),exitCode:1});let d=u.value;if(s.writeln(O(`
|
|
25
|
+
Scaffolded ${d.templateName} to ${d.targetDir}`)),Object.keys(d.variables).length>0){s.writeln(w(`
|
|
26
|
+
Variables applied:`));for(let[h,b]of Object.entries(d.variables))s.writeln(w(" "),S(h),w(`: ${b}`))}if(d.postInstallCommands.length>0){s.writeln(w(`
|
|
27
|
+
Post-install commands executed:`));for(let h of d.postInstallCommands)s.writeln(w(" "),S(h))}return await s.close(),E(void 0)};export{I as fetchTemplate,ie as getDefaultProvider,ae as getProvider,R as hasVariables,j as loadTemplateConfig,ze as main,X as parseSpecifier,B as registerProvider,F as resolveVariables,k as scaffold,T as substituteVariables};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{a as Pe}from"./chunk-AYSPDG4K.js";import{a as $e}from"./chunk-NTPOK5H6.js";import{a as ke,c as he}from"./chunk-W3REWI3H.js";import{a as xe,c as be}from"./chunk-XMCQMTAA.js";import{a as Ve,c as we}from"./chunk-VVHXAOEH.js";import{a as Ce}from"./chunk-TUTRX7VR.js";import{a as Se}from"./chunk-4HAIX3WN.js";import{a as De}from"./chunk-HTBLWLKV.js";import{a as Te}from"./chunk-GVSBZ6JV.js";import"./chunk-AKJB4CER.js";import{a as Fe,c as Re}from"./chunk-JOXKA7TJ.js";import{a as ae,c as se}from"./chunk-G34MS4XJ.js";import{a as oe,c as ie}from"./chunk-ANY26ROY.js";import{a as re,c as ne}from"./chunk-H4OFOQQ2.js";import{a as le,c as de}from"./chunk-U65FD6J3.js";import{a as ce,c as pe}from"./chunk-6HYGGBEQ.js";import{a as me,c as ue}from"./chunk-QZY4BKI7.js";import{a as fe,c as ge}from"./chunk-4VL2RZIN.js";import{a as ve,c as ye}from"./chunk-NGZZAQ7G.js";import{a as K,c as U}from"./chunk-PO3SXFUE.js";import{a as X,c as H}from"./chunk-YWCEHTZB.js";import{a as Q,c as Z}from"./chunk-YMY2URYM.js";import{a as ee,c as te}from"./chunk-YQU3TEIG.js";import{a as G}from"./chunk-SBOTNOWZ.js";import"./chunk-CPRLAMEG.js";import{b as B,c as Y}from"./chunk-3I4JG3PJ.js";import"./chunk-V2N5L24J.js";import"./chunk-Y6DZEK4W.js";import"./chunk-34GCQZ3Z.js";import"./chunk-3APERFKY.js";import"./chunk-6U2VEZEM.js";import"./chunk-KAEAT6A4.js";import"./chunk-ZH37DSUQ.js";import"./chunk-LOFP256P.js";import"./chunk-ZF2XYULB.js";import"./chunk-4S7QYPS6.js";import"./chunk-NUSNMQPL.js";import"./chunk-GXPLME3K.js";import{b as _}from"./chunk-2J2PXBOC.js";import{f as W,h as J,k as z}from"./chunk-TTYO2XJO.js";import"./chunk-USCAYIWL.js";import{b as g,d as y,e as x,f as R,g as L,j as q}from"./chunk-PLJNPQFC.js";import"./chunk-BCHXUKWW.js";import{a as O}from"./chunk-HPPFA3XU.js";import{a as T,b as A}from"./chunk-DQAEQEXD.js";import{t as F}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var C=async t=>{let s=await B(t);return s===null?null:s},Me=async t=>await Y(t);var P={name:"validate-circular-deps",description:"Detect circular package dependencies",requiredStacks:[],async validate(t){let s=await De({root:t.root});return{name:"validate-circular-deps",passed:!s.hasCycles,issues:s.cycles.map(a=>({severity:"error",message:`Circular dependency: ${a.join(" \u2192 ")}`})),stats:{packagesChecked:s.packagesChecked}}}};var $={name:"validate-mod-exports",description:"Validate mod.ts exports all files",requiredStacks:["javascript"],async validate(t){let s=await Pe({root:t.root});return{name:"validate-mod-exports",passed:s.isComplete,issues:s.missingExports.map(a=>({severity:"error",message:`Missing export in ${a.packageName}: ${a.file}`,file:a.file})),stats:{packagesChecked:s.packagesChecked}}}};var E={name:"validate-export-names",description:"Validate export naming conventions",requiredStacks:["javascript"],async validate(t){let s=await Te({root:t.root});return{name:"validate-export-names",passed:s.isValid,issues:s.violations.map(a=>({severity:"error",message:`${a.packageName}: "${a.exportPath}" should be "${a.suggestion}"`})),stats:{packagesChecked:s.packagesChecked}}}};var j={name:"validate-docs",description:"Validate JSDoc documentation",requiredStacks:["javascript"],async validate(t){let s=t.options?.requireExamples,a=await Se({root:t.root,requireExamples:s});return{name:"validate-docs",passed:a.isValid,issues:a.issues.map(e=>({severity:"error",message:`${e.symbol}: ${e.issue}`,file:e.file,line:e.line})),stats:{filesChecked:a.filesChecked,symbolsChecked:a.symbolsChecked}}}};var M={name:"validate-package-configs",description:"Validate deno.json/package.json consistency",requiredStacks:["javascript"],async validate(t){let s=await $e({root:t.root}),a=[];for(let e of s.inconsistencies)a.push({severity:"error",message:`${e.packageName}: ${e.field} mismatch - deno.json: ${JSON.stringify(e.denoValue)}, package.json: ${JSON.stringify(e.packageValue)}`});for(let e of s.dependencyInconsistencies){let i=`${e.packageName}: ${e.dependencyName} - ${e.issue}`;e.expected!==void 0&&e.actual!==void 0&&(i+=` (expected: ${e.expected}, actual: ${e.actual})`),a.push({severity:"error",message:i})}return{name:"validate-package-configs",passed:s.isConsistent,issues:a,stats:{packagesChecked:s.packagesChecked}}}};var qe=[{pattern:/\bDeno\.cwd\(\)/,replacement:"runtime.process.cwd()"},{pattern:/\bDeno\.env\.get\b/,replacement:"runtime.env.get()"},{pattern:/\bDeno\.env\.set\b/,replacement:"runtime.env.set()"},{pattern:/\bDeno\.env\.delete\b/,replacement:"runtime.env.delete()"},{pattern:/\bDeno\.env\.has\b/,replacement:"runtime.env.has()"},{pattern:/\bDeno\.env\.toObject\b/,replacement:"runtime.env.toObject()"},{pattern:/\bDeno\.readTextFile\b/,replacement:"runtime.fs.readTextFile()"},{pattern:/\bDeno\.readFile\b/,replacement:"runtime.fs.readFile()"},{pattern:/\bDeno\.writeTextFile\b/,replacement:"runtime.fs.writeTextFile()"},{pattern:/\bDeno\.writeFile\b/,replacement:"runtime.fs.writeFile()"},{pattern:/\bDeno\.mkdir\b/,replacement:"runtime.fs.mkdir()"},{pattern:/\bDeno\.remove\b/,replacement:"runtime.fs.remove()"},{pattern:/\bDeno\.stat\b/,replacement:"runtime.fs.stat()"},{pattern:/\bDeno\.lstat\b/,replacement:"runtime.fs.lstat()"},{pattern:/\bDeno\.readDir\b/,replacement:"runtime.fs.readDir()"},{pattern:/\bDeno\.copyFile\b/,replacement:"runtime.fs.copyFile()"},{pattern:/\bDeno\.rename\b/,replacement:"runtime.fs.rename()"},{pattern:/\bDeno\.open\b/,replacement:"runtime.fs (or @eser/streams)"},{pattern:/\bDeno\.exit\b/,replacement:"runtime.process.exit()"},{pattern:/\bnew Deno\.Command\b/,replacement:"runtime.exec.spawn() (or @eser/shell/exec)"},{pattern:/\bDeno\.args\b/,replacement:"runtime.process.args"}],We=[],Je=t=>We.some(s=>s.test(t)),ze=(t,s)=>{let a=t.slice(0,s);return a.includes("//")||a.includes("/*")&&!a.includes("*/")},_e=(t,s)=>{let a=!1,e=!1,i=!1;for(let n=0;n<s;n++){let l=t[n];(n>0?t[n-1]:"")!=="\\"&&(l==="'"&&!e&&!i&&(a=!a),l==='"'&&!a&&!i&&(e=!e),l==="`"&&!a&&!e&&(i=!i))}return a||e||i},b=G({name:"validate-runtime-js-apis",description:"Detect direct usage of runtime-specific APIs (use @eser/standards/cross-runtime instead)",canFix:!1,stacks:["javascript"],defaults:{},extensions:_,checkFile(t,s){if(s===void 0)return[];if(Je(t.path))return[];let a=[],e=s.split(`
|
|
2
|
+
`);for(let i=0;i<e.length;i++){let n=e[i];for(let{pattern:l,replacement:d}of qe){let c=l.exec(n);c!==null&&(ze(n,c.index)||_e(n,c.index)||a.push({path:t.path,line:i+1,message:`direct Deno API usage: ${c[0]} \u2014 use @eser/standards/cross-runtime (${d})`}))}}return a}}),ct=b.run,Ee=b.validator,pt=b.main;var k={validators:new Map,initialized:!1},Ye=()=>{o(P),o($),o(E),o(j),o(M),o(U),o(H),o(Z),o(te),o(se),o(ie),o(ne),o(de),o(pe),o(ue),o(ge),o(ye),o(he),o(be),o(we),o(Re),o(Ee)},I=()=>{k.initialized||(k.initialized=!0,Ye())},o=t=>{k.validators.set(t.name,t)},Ge=t=>(I(),k.validators.get(t)??null),N=()=>(I(),[...k.validators.values()]),Ke=()=>(I(),[...k.validators.keys()]),Ue=t=>({name:t.config.name,description:t.config.description,run:async s=>{let a=await t.run(s);return{name:a.name,passed:a.issues.length===0,issues:a.issues.map(e=>({path:e.path,line:e.line,message:e.message,fixed:e.fixed})),mutations:a.mutations.map(e=>({path:e.path,oldContent:e.oldContent,newContent:e.newContent})),stats:{filesChecked:a.filesChecked,issuesFound:a.issues.length}}}}),Xe=t=>({name:t.name,description:t.description,run:async s=>{let a=await t.validate({root:s.root??".",options:s});return{name:a.name,passed:a.passed,issues:a.issues.map(e=>({path:e.file,line:e.line,message:e.message})),mutations:[],stats:a.stats}}}),He=()=>{let t=[],s=[K,X,Q,ee,ae,oe,re,le,ce,me,fe,ve,ke,xe,Ve,Fe,b];for(let e of s)t.push(Ue(e));let a=[P,$,E,j,M];for(let e of a)t.push(Xe(e));return t.push({name:"validate-commit-msg",description:"Validate conventional commit format",run:async e=>{let i=e.commitMsgFile??e._args?.[0]??".git/COMMIT_EDITMSG",{runtime:n}=await import("./mod-WYRORC72.js"),l;try{l=await n.fs.readTextFile(i)}catch{return{name:"validate-commit-msg",passed:!1,issues:[{message:`cannot read commit message file: ${i}`}],mutations:[],stats:{}}}let d=Ce(l,{allowAsterisk:e.allowAsterisk,allowMultipleScopes:e.allowMultipleScopes,forceScope:e.forceScope,types:e.types});return{name:"validate-commit-msg",passed:d.valid,issues:d.issues.map(c=>({message:c})),mutations:[],stats:{}}}}),t};var Qe=async(t={})=>{let s=t.root??F.process.cwd(),e=(await C(s))?.stack??[],i=[...t.skip??[]],n=t.only??[],l=N(),d=[],c=[],V=[];for(let p of l){if(n.length>0&&!n.includes(p.name))continue;if(i.includes(p.name)){V.push(p.name);continue}if(p.requiredStacks.length>0&&e.length>0&&!p.requiredStacks.some(w=>e.includes(w))){c.push({name:p.name,reason:`Requires '${p.requiredStacks.join("' or '")}' stack`});continue}let S={...t.fix!==void 0?{fix:t.fix}:{}},m=await p.validate({root:s,options:S});d.push(m)}return{passed:d.every(p=>p.passed),results:d,skipped:c,disabled:V}},Ot=async t=>{let s=O(t??F.process.args,{string:["root","only","skip"],boolean:["fix","help"],alias:{h:"help"}});if(s.help)return console.log("Usage: deno run --allow-all ./validation/mod.ts [options]"),console.log(),console.log("Options:"),console.log(" --root <dir> Root directory (default: cwd)"),console.log(" --only <validators> Run only specific validators (comma-separated)"),console.log(" --skip <validators> Skip specific validators (comma-separated)"),console.log(" --fix Auto-fix issues where supported"),console.log(" -h, --help Show this help message"),T(void 0);let a=z.ansi(),e=W({renderer:a,sink:J.stdout()}),i=s.root,n=s.fix,l=s.only,d=s.skip,c=l!==void 0?l.split(",").map(r=>r.trim()):void 0,V=d!==void 0?d.split(",").map(r=>r.trim()):void 0,S=(await C(i??"."))?.stack?.join(", ")??"all (no .manifest.yml)";e.writeln(g(`Validating codebase...
|
|
3
|
+
`)),e.writeln(g("Stack: "),q(S),g(`
|
|
4
|
+
`));let m=await Qe({root:i,only:c,skip:V,fix:n});for(let r of m.results){let u=r.passed?R("PASS"):x("FAIL"),v=Object.entries(r.stats).map(([f,D])=>`${D} ${f}`).join(", ");e.writeln(g(` ${r.name.padEnd(18)} `),u,g(` (${v})`))}if(m.skipped.length>0){e.writeln(y(`
|
|
5
|
+
Skipped (stack not configured):`));for(let r of m.skipped)e.writeln(y(` - ${r.name}: ${r.reason}`))}if(m.disabled.length>0){e.writeln(y(`
|
|
6
|
+
Disabled:`));for(let r of m.disabled)e.writeln(y(` - ${r}`))}let h=m.results.flatMap(r=>r.issues.map(u=>({validator:r.name,...u})));if(h.length>0){e.writeln(x(`
|
|
7
|
+
Issues (${h.length}):
|
|
8
|
+
`));let r=new Map;for(let u of h){let v=u.file??u.validator,f=r.get(v)??[];f.push(u),r.set(v,f)}for(let[u,v]of r){e.writeln(y(` ${u}`));for(let f of v){let D=f.severity==="error"?x("error"):L("warning"),je=f.line!==void 0?`:${f.line}`:"";e.writeln(g(" "),D,g(`${je}: ${f.message}`))}e.writeln()}}let w=m.results.filter(r=>!r.passed).length;return w>0?(await e.close(),A({message:a.render([x(`
|
|
9
|
+
${w} check(s) failed with ${h.length} issue(s)`)]),exitCode:1})):(e.writeln(R(`
|
|
10
|
+
All checks passed!`)),await e.close(),T(void 0))};export{Me as getProjectConfigPath,Ge as getValidator,Ke as getValidatorNames,N as getValidators,He as getWorkflowTools,C as loadProjectConfig,Ot as main,o as registerValidator,Qe as validate};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as T,h as J}from"./chunk-
|
|
1
|
+
import{c as T,h as J}from"./chunk-5RK3346P.js";import{a as S}from"./chunk-4H4O3TGK.js";import{b as B,c as W}from"./chunk-2J2PXBOC.js";import{e as h}from"./chunk-OBIEQJDE.js";import"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import"./chunk-BCHXUKWW.js";import"./chunk-GLSCZGXA.js";import"./chunk-ZE5T64HQ.js";import{t as i}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var P=h.getLogger(["laroux-bundler","rsc-analyze"]);function Z(t){return{filePath:t.filePath,relativePath:t.relativePath,exportNames:[...t.exports]}}async function E(t,e,n){if(P.debug(`\u{1F50D} Analyzing client components in: ${t}`),!n){let p=(await T(t,{projectRoot:e})).map(Z);return P.debug(`\u{1F4CA} Total client components found: ${p.length}`),p}let r=[],o=0,a=0,l=await T(t,{projectRoot:e});for(let s of l){let p=0;try{p=(await i.fs.stat(s.filePath)).mtime?.getTime()??0}catch{continue}let c=n.getClientComponent(s.filePath,p);if(c){o++,c.isClient&&r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:c.exportNames});continue}a++;let x=[...s.exports];n.setClientComponent(s.filePath,!0,x,p),r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:x}),P.debug(` \u2713 Found client component: ${s.relativePath} (exports: ${x.join(", ")})`)}return(o>0||a>0)&&P.debug(`\u{1F4CA} Component analysis: ${o} cache hits, ${a} analyzed`),P.debug(`\u{1F4CA} Total client components found: ${r.length}`),r}async function _(t){let e=[],n=/(?:node_modules|\.test\.|\.spec\.)/;for await(let r of S(t,"**/*.{tsx,ts,jsx,js}",n))e.push(i.path.join(t,r));return e}var v=h.getLogger(["laroux-bundler","rsc-transform"]);async function H(t,e){let n=i.path.dirname(t.relativePath),r=i.path.join(e,n);await i.fs.ensureDir(r);let o=tt(t),a=t.relativePath.split("/").pop(),l=i.path.join(r,a);return await i.fs.writeTextFile(l,o),{originalPath:t.filePath,transformedPath:l}}function tt(t){let e=t.exportNames.map(n=>n==="default"?`export default createClientReference(
|
|
2
2
|
"./${t.relativePath}",
|
|
3
3
|
"default"
|
|
4
4
|
);`:`export const ${n} = createClientReference(
|
|
@@ -18,7 +18,7 @@ import { createClientReference } from "@eser/laroux-react/protocol";
|
|
|
18
18
|
${e.join(`
|
|
19
19
|
|
|
20
20
|
`)}
|
|
21
|
-
`}async function A(t,e,n){v.debug(`\u{1F504} Transforming ${t.length} client component(s)...`);let r=[];for(let o of t){let a=await H(o,e);v.debug(` \u2713 ${o.relativePath} \u2192 ${i.path.relative(n,a.transformedPath)}`),r.push(a)}return v.debug("\u2705 Transformation complete"),r}function et(t){let e=new Map;for(let n of t){e.set(`./${n.originalPath}`,n.transformedPath);let r=n.originalPath.split("/").pop();e.set(`./${r}`,n.transformedPath)}return e}async function U(t,e,n){let r={generated:new Date().toISOString(),components:t.map(o=>({original:o.originalPath,transformed:i.path.relative(n,o.transformedPath)}))};await i.fs.writeTextFile(e,JSON.stringify(r,null,2)),v.debug(`\u{1F4DD} Transform manifest saved to: ${i.path.relative(n,e)}`)}var nt=h.getLogger(["laroux-bundler","rsc-module-map"]);function L(t){let e={};for(let n of t){let r=`./${n.relativePath}`,o=W(n.relativePath,".js");e[r]={id:r,chunks:[o],name:n.exportNames[0]??"default"}}return e}function rt(t){let e={};for(let[n,r]of Object.entries(t))e[n]={id:r.id,chunks:r.chunks,name:r.name};return e}async function F(t,e){let n=JSON.stringify(t,null,2);await i.fs.writeTextFile(e,n),nt.debug(`\u{1F4DD} Module map saved to: ${e}`)}async function ot(t){let e=await i.fs.readTextFile(t);return JSON.parse(e)}function N(t){let e={};for(let n of t)e[n.relativePath]={id:n.relativePath,chunks:["client.js"],name:n.exportNames[0]??"default"};return e}var u=h.getLogger(["laroux-bundler","rsc-rewrite-imports"]);function st(t,e){let n=!1,r=!1,o=!1,a="";for(let l=0;l<e;l++){let s=t[l];if(s===void 0)break;if(a==="\\"){a=s;continue}s==="'"&&!r&&!o?n=!n:s==='"'&&!n&&!o?r=!r:s==="`"&&!n&&!r&&(o=!o),a=s}return n||r||o}function Q(t){let e=[],n=/import\s+(?:type\s+)?(?:(?:\{[^}]*\}|\*\s+as\s+\w+|\w+)(?:\s*,\s*(?:\{[^}]*\}|\*\s+as\s+\w+|\w+))*\s+from\s+)?["']([^"']+)["'];?/g,r;for(;(r=n.exec(t))!==null;){let o=r[1];o&&(st(t,r.index)||(o.startsWith("./")||o.startsWith("../")||o.startsWith("@/"))&&e.push({original:r[0],path:o,startIndex:r.index,endIndex:r.index+r[0].length}))}return e}function G(t,e,n){if(e.startsWith("@/")){let a=e.slice(2);return i.path.join(n,"src",a)}let r=i.path.dirname(t);return i.path.resolve(r,e)}function it(t,e){if(e.has(t))return e.get(t);let n=B.map(r=>`.${r}`);for(let r of n){let o=t.endsWith(r)?t:t+r;if(e.has(o))return e.get(o)}return null}function X(t,e){if(e.has(t))return e.get(t);if(!t.endsWith(".module.css")){let n=t+".module.css";if(e.has(n))return e.get(n)}return null}async function q(t,e,n,r,o){let a=await i.fs.readTextFile(t),l=Q(a),s=a,p=0,
|
|
21
|
+
`}async function A(t,e,n){v.debug(`\u{1F504} Transforming ${t.length} client component(s)...`);let r=[];for(let o of t){let a=await H(o,e);v.debug(` \u2713 ${o.relativePath} \u2192 ${i.path.relative(n,a.transformedPath)}`),r.push(a)}return v.debug("\u2705 Transformation complete"),r}function et(t){let e=new Map;for(let n of t){e.set(`./${n.originalPath}`,n.transformedPath);let r=n.originalPath.split("/").pop();e.set(`./${r}`,n.transformedPath)}return e}async function U(t,e,n){let r={generated:new Date().toISOString(),components:t.map(o=>({original:o.originalPath,transformed:i.path.relative(n,o.transformedPath)}))};await i.fs.writeTextFile(e,JSON.stringify(r,null,2)),v.debug(`\u{1F4DD} Transform manifest saved to: ${i.path.relative(n,e)}`)}var nt=h.getLogger(["laroux-bundler","rsc-module-map"]);function L(t){let e={};for(let n of t){let r=`./${n.relativePath}`,o=W(n.relativePath,".js");e[r]={id:r,chunks:[o],name:n.exportNames[0]??"default"}}return e}function rt(t){let e={};for(let[n,r]of Object.entries(t))e[n]={id:r.id,chunks:r.chunks,name:r.name};return e}async function F(t,e){let n=JSON.stringify(t,null,2);await i.fs.writeTextFile(e,n),nt.debug(`\u{1F4DD} Module map saved to: ${e}`)}async function ot(t){let e=await i.fs.readTextFile(t);return JSON.parse(e)}function N(t){let e={};for(let n of t)e[n.relativePath]={id:n.relativePath,chunks:["client.js"],name:n.exportNames[0]??"default"};return e}var u=h.getLogger(["laroux-bundler","rsc-rewrite-imports"]);function st(t,e){let n=!1,r=!1,o=!1,a="";for(let l=0;l<e;l++){let s=t[l];if(s===void 0)break;if(a==="\\"){a=s;continue}s==="'"&&!r&&!o?n=!n:s==='"'&&!n&&!o?r=!r:s==="`"&&!n&&!r&&(o=!o),a=s}return n||r||o}function Q(t){let e=[],n=/import\s+(?:type\s+)?(?:(?:\{[^}]*\}|\*\s+as\s+\w+|\w+)(?:\s*,\s*(?:\{[^}]*\}|\*\s+as\s+\w+|\w+))*\s+from\s+)?["']([^"']+)["'];?/g,r;for(;(r=n.exec(t))!==null;){let o=r[1];o&&(st(t,r.index)||(o.startsWith("./")||o.startsWith("../")||o.startsWith("@/"))&&e.push({original:r[0],path:o,startIndex:r.index,endIndex:r.index+r[0].length}))}return e}function G(t,e,n){if(e.startsWith("@/")){let a=e.slice(2);return i.path.join(n,"src",a)}let r=i.path.dirname(t);return i.path.resolve(r,e)}function it(t,e){if(e.has(t))return e.get(t);let n=B.map(r=>`.${r}`);for(let r of n){let o=t.endsWith(r)?t:t+r;if(e.has(o))return e.get(o)}return null}function X(t,e){if(e.has(t))return e.get(t);if(!t.endsWith(".module.css")){let n=t+".module.css";if(e.has(n))return e.get(n)}return null}async function q(t,e,n,r,o){let a=await i.fs.readTextFile(t),l=Q(a),s=a,p=0,c=0;for(let m of l){let C=G(t,m.path,o);if(X(C,n)){let M=m.path.endsWith(".module.css")?`${m.path}.json`:`${m.path}.module.css.json`,y=m.original.match(/^import\s+["']/),f;y?f=m.original.replace(/^import\s+["']([^"']+)["'];?/,`import styles from "${M}" with { type: "json" };`):f=m.original.replace(`"${m.path}"`,`"${M}" with { type: "json" }`).replace(`'${m.path}'`,`'${M}' with { type: "json" }`);let d=m.startIndex+c,w=m.endIndex+c;s=s.slice(0,d)+f+s.slice(w),c+=f.length-m.original.length,p++;continue}let $=it(C,e);if($){let M=i.path.relative(o,t),y=i.path.join(r,M),f=i.path.relative(i.path.dirname(y),$),d=f.startsWith(".")?f:`./${f}`,w=m.original.replace(`"${m.path}"`,`"${d}"`).replace(`'${m.path}'`,`'${d}'`),I=m.startIndex+c,b=m.endIndex+c;s=s.slice(0,I)+w+s.slice(b),c+=w.length-m.original.length,p++}else if(m.path.startsWith("@/")){let M=i.path.relative(o,t),y=i.path.join(r,M),f=i.path.join(o,"dist","server","src",m.path.slice(2)),d=i.path.relative(i.path.dirname(y),f),w=d.startsWith(".")?d:`./${d}`,I=m.original.replace(`"${m.path}"`,`"${w}"`).replace(`'${m.path}'`,`'${w}'`),b=m.startIndex+c,Y=m.endIndex+c;s=s.slice(0,b)+I+s.slice(Y),c+=I.length-m.original.length,p++}}let x=i.path.relative(o,t),g=i.path.join(r,x);return await i.fs.ensureDir(i.path.dirname(g)),await i.fs.writeTextFile(g,s),{originalPath:t,rewrittenPath:g,importsRewritten:p}}function K(t){let e=new Map;for(let n of t){e.set(n.originalPath,n.transformedPath);let r=n.originalPath.replace(/\.(tsx|ts|jsx|js)$/,"");e.set(r,n.transformedPath)}return e}function R(t){let e=new Map;for(let n of t){let r=n.replace(/\.module\.css$/,".module.css.json");e.set(n,r);let o=n.replace(/\.module\.css$/,"");e.set(o,r)}return e}async function z(t,e,n,r,o){u.debug(`\u{1F504} Rewriting imports in ${t.length} server component(s)...`);let a=K(e),l=R(n);u.debug(` Found ${n.length} CSS module(s) to track`);let s=[];for(let p of t){let c=await q(p,a,l,r,o);c.importsRewritten>0?u.debug(` \u2713 ${i.path.relative(o,p)} (${c.importsRewritten} import(s) rewritten)`):u.debug(` \u2713 ${i.path.relative(o,p)} (no client imports)`),s.push(c)}return u.debug("\u2705 Import rewriting complete"),s}async function V(t,e,n){let r=await i.fs.readTextFile(t),o=Q(r),a=r,l=0,s=0;for(let p of o){let c=G(t,p.path,n);if(X(c,e)){let g=p.path.endsWith(".module.css")?`${p.path}.json`:`${p.path}.module.css.json`,m=p.original.match(/^import\s+["']/),C;m?C=p.original.replace(/^import\s+["']([^"']+)["'];?/,`import styles from "${g}" with { type: "json" };`):C=p.original.replace(`"${p.path}"`,`"${g}" with { type: "json" }`).replace(`'${p.path}'`,`'${g}' with { type: "json" }`);let O=p.startIndex+s,$=p.endIndex+s;a=a.slice(0,O)+C+a.slice($),s+=C.length-p.original.length,l++}}return l>0&&await i.fs.writeTextFile(t,a),{importsRewritten:l}}async function at(t,e,n,r){u.debug(`\u{1F504} Rewriting CSS module imports in ${t.length} client component(s)...`);let o=R(e);u.debug(` Found ${e.length} CSS module(s) to track`);let a=0;for(let l of t){let s=await V(l.filePath,o,r);s.importsRewritten>0&&(u.debug(` \u2713 ${i.path.relative(r,l.filePath)} (${s.importsRewritten} CSS import(s) rewritten)`),a+=s.importsRewritten)}a>0?u.debug(`\u2705 Rewrote ${a} CSS module import(s) in ${t.length} client component(s)`):u.debug("\u2705 No CSS module imports found in client components")}async function D(t,e,n){u.debug("\u{1F504} Rewriting CSS module imports in all src files...");let r=R(e),o=[];for await(let l of S(t,"**/*.{tsx,ts}",/node_modules/))o.push(i.path.join(t,l));u.debug(` Found ${o.length} source file(s) to check`);let a=0;for(let l of o){let s=await V(l,r,n);s.importsRewritten>0&&(u.debug(` \u2713 ${i.path.relative(n,l)} (${s.importsRewritten} CSS import(s) rewritten)`),a+=s.importsRewritten)}a>0?u.debug(`\u2705 Rewrote ${a} CSS module import(s) in ${o.length} source file(s)`):u.debug("\u2705 No CSS module imports needed rewriting")}var lt=["entry.tsx","error-boundary.tsx","error-overlay.tsx","globals.d.ts","hmr-client.tsx","index.ts","lazy-loader.ts","smart-refresh.tsx"];function pt(t){if(t.startsWith("jsr:"))return!0;if(URL.canParse(t)){let e=new URL(t);return e.protocol==="https:"||e.protocol==="http:"}return!1}function mt(t){return URL.canParse(t)&&t.startsWith("file://")?new URL(t).pathname:t}function ct(t){let e=t.match(/^jsr:@([^/]+)\/([^@]+)@[\^~]?([^/]+)(.*)$/);if(e){let[,r,o,a,l]=e;return`${new URL(`https://jsr.io/@${r}/${o}/${a}`).href}${l}`}let n=t.match(/^jsr:@([^/]+)\/([^/]+)(.*)$/);if(n){let[,r,o,a]=n;return`${new URL(`https://jsr.io/@${r}/${o}`).href}${a}`}throw new Error(`Cannot parse JSR specifier: ${t}`)}function ut(t){return t.replace(/@jsxImportSource\s+npm:react@[^\s*]+/g,"@jsxImportSource react").replace(/@jsxImportSourceTypes\s+npm:react@[^\s*]+/g,"@jsxImportSourceTypes react").replace(/from\s+["']jsr:(@[^@]+)@[^"'/]+([^"']*)["']/g,'from "$1$2"').replace(/import\s*\(\s*["']jsr:(@[^@]+)@[^"'/]+([^"']*)["']\s*\)/g,'import("$1$2")').replace(/from\s+["']npm:\/?([^@]+)@[^"'/]+([^"']*)["']/g,'from "$1$2"').replace(/import\s*\(\s*["']npm:\/?([^@]+)@[^"'/]+([^"']*)["']\s*\)/g,'import("$1$2")')}function ft(){let e=import.meta.resolve("@eser/laroux-react/client/bootstrap").replace(/\/index\.ts$/,"");return e.startsWith("jsr:")&&(e=ct(e)),{isRemote:pt(e),baseUrl:e}}async function gt(t){let{isRemote:e,baseUrl:n}=ft();for(let r of lt){let o=i.path.resolve(t,r),a=n.endsWith("/")?new URL(r,n).href:new URL(`${n}/${r}`).href;if(e)try{let l=await fetch(a);if(!l.ok)throw new Error(`HTTP ${l.status}`);let s=await l.text();s=ut(s),await i.fs.writeTextFile(o,s)}catch(l){throw new Error(`Failed to fetch bootstrap file ${r} from ${a}: ${l instanceof Error?l.message:String(l)}`)}else{let l=mt(a);await J(l,o,{overwrite:!0})}}}async function k(t,e,n){let r=i.path.resolve(n,"_client-entry.tsx");await i.fs.ensureDir(n),await gt(n);let o=t.map((s,p)=>`import * as __component_${p} from "${s.filePath}";`).join(`
|
|
22
22
|
`),a=t.map((s,p)=>` __RUNTIME_MODULES__["${`./${s.relativePath}`}"] = __component_${p};`).join(`
|
|
23
23
|
`),l=`/**
|
|
24
24
|
* Auto-generated Client Entry Point - Runtime Bundle
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as S}from"./chunk-2J2PXBOC.js";import{e as q}from"./chunk-OBIEQJDE.js";import"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import{t as n}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var h=q.getLogger(["laroux","image-optimizer"]),$=null;async function j(){return $===null&&($=await import("npm:sharp@^0.33.5")),$.default??$}var F={formats:["webp","original"],widths:[640,768,1024,1280,1920],quality:{webp:80,avif:75,jpeg:85,png:90},generateBlurPlaceholder:!0,placeholderWidth:10};async function B(i){let r=[],o=["jpg","jpeg","png","gif","webp"];async function a(t){try{for await(let e of n.fs.readDir(t)){let s=n.path.resolve(t,e.name);e.isDirectory?await a(s):e.isFile&&S(e.name.toLowerCase(),o)&&r.push(s)}}catch{}}return await a(i),r}async function E(i,r){return`data:image/webp;base64,${(await(await j())(i).resize(r,void 0,{fit:"inside"}).blur(5).webp({quality:20}).toBuffer()).toString("base64")}`}async function C(i,r,o,a={}){let t=await j(),e={...F,...a},s=t(i),l=await s.metadata();if(l.width===void 0||l.height===void 0)throw new Error(`Could not read image dimensions: ${i}`);let u=l.width,w=l.height,y=u/w,m=n.path.extname(i),p=m.slice(1).toLowerCase(),f=n.path.basename(i,m),x=`${o}/${f}`,I=[];for(let c of e.widths){if(c>u)continue;let O=Math.round(c/y);for(let b of e.formats){let z,d;b==="original"?(d=p,z=n.path.resolve(r,`${f}-${c}w.${p}`)):(d=b,z=n.path.resolve(r,`${f}-${c}w.${b}`)),await n.fs.ensureDir(n.path.dirname(z));let g=s.clone().resize(c,O,{fit:"cover"});b==="webp"?g=g.webp({quality:e.quality.webp}):b==="avif"?g=g.avif({quality:e.quality.avif}):d==="jpg"||d==="jpeg"?g=g.jpeg({quality:e.quality.jpeg}):d==="png"&&(g=g.png({quality:e.quality.png}));let P=await g.toBuffer();await n.fs.writeFile(z,P),I.push({path:z,format:d,width:c,height:O,size:P.length})}}let v;return e.generateBlurPlaceholder&&(v=await E(i,e.placeholderWidth)),{originalPath:i,publicPath:x,originalWidth:u,originalHeight:w,variants:I,blurDataUrl:v,aspectRatio:y}}async function V(i,r,o="/images",a={}){h.info(`Scanning for images in ${i}...`);let t=await B(i);if(t.length===0)return h.debug("No images found to optimize"),{timestamp:Date.now(),images:{}};h.info(`Found ${t.length} image(s) to optimize`);let e={},s=0,l=0;for(let m of t)try{let p=await n.fs.stat(m);s+=p.size;let f=await C(m,r,o,a);e[m]=f;let x=f.variants.reduce((I,v)=>I+v.size,0);l+=x,h.debug(`Optimized: ${n.path.basename(m)} \u2192 ${f.variants.length} variants`)}catch(p){h.warn(`Failed to optimize ${m}: ${p instanceof Error?p.message:String(p)}`)}let u={timestamp:Date.now(),images:e},w=n.path.resolve(r,"image-manifest.json");await n.fs.ensureDir(n.path.dirname(w)),await n.fs.writeTextFile(w,JSON.stringify(u,null,2));let y=s>0?((1-l/s)*100).toFixed(1):0;return h.info(`Image optimization complete: ${t.length} images, ${y}% size reduction`),u}function M(i,r="webp"){return i.variants.filter(a=>a.format===r).sort((a,t)=>a.width-t.width).map(a=>`${a.path} ${a.width}w`).join(", ")}function D(i,r,o="webp"){let a=i.variants.filter(t=>t.format===o).sort((t,e)=>t.width-e.width);return a.find(t=>t.width>=r)??a.at(-1)}export{M as generateSrcset,D as getBestVariant,C as optimizeImage,V as optimizeImages,B as scanImages};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-UKYKMDYU.js";import"./chunk-4H4O3TGK.js";import"./chunk-2J2PXBOC.js";import"./chunk-OBIEQJDE.js";import"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import"./chunk-BCHXUKWW.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{e as ABOVE_FOLD_PATTERNS,d as CRITICAL_LAYERS,f as CRITICAL_PROPERTY_PATTERNS,m as DEFAULT_CRITICAL_UNIVERSAL_CSS,b as compileTailwind,n as createTailwindPlugin,c as expandApplyDirectives,h as extractCriticalPageCss,j as extractCriticalUniversalCss,l as extractThemeLayer,i as generateAsyncCssLoader,k as generateCriticalUniversalCss,g as getDefaultCriticalCssConfig,a as loadStylesheet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,q as o,r as p,s as q,t as r}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,q as o,r as p,s as q,t as r}from"./chunk-ETMOOGY2.js";import"./chunk-OBIEQJDE.js";import"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{j as chunkToInlineScript,l as createInlineRSCStream,k as createInlineTransformStream,q as createReactHtmlShellBuilder,o as createReactRenderer,m as generateInlineBootstrapScript,n as generateInlineCompletionScript,c as generateRSCPayloadScript,e as loadModuleMap,r as reactHtmlShellBuilder,p as reactRenderer,i as renderApp,f as renderRSC,h as renderRSCResponse,a as renderSSR,d as renderToReadableStream,b as serializeRSCPayload,g as streamToResponse};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f}from"./chunk-ZO7RUTSQ.js";import"./chunk-LOFP256P.js";import"./chunk-TTYO2XJO.js";import"./chunk-PLJNPQFC.js";import"./chunk-BCHXUKWW.js";import"./chunk-EBYJBBYV.js";import"./chunk-DQAEQEXD.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{d as completionsHandler,f as doctorHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,b as f,c as g,d as h,e as i,f as j,g as k,h as l,i as m,j as n,k as o,l as r,m as s,n as t,o as u,p as v,q as w,r as x,s as A,t as B,u as C}from"./chunk-YXSB6RET.js";import{b as y,c as z}from"./chunk-SG4G3OOO.js";import{a as p,b as q}from"./chunk-FDZP7B5Y.js";import{a,b,c,d}from"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{c as AlreadyExistsError,b as NotFoundError,d as ProcessError,a as RuntimeCapabilityError,u as buildCommand,z as clearWorkerdEnv,A as createRuntime,C as current,x as detectExecutionContext,t as detectInvoker,e as detectRuntime,l as getArch,w as getCliCommand,m as getHomedir,k as getPlatform,o as getPlatformInfo,f as getRuntimeVersion,n as getTmpdir,h as isBrowser,v as isCommandInPath,j as isEdge,g as isRuntime,i as isServer,y as populateEnvFromContext,q as posixPath,s as resolvePathDirs,B as runtime,r as searchFileHierarchy,p as toPosix};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as b,b as D}from"./chunk-NLNSK3KE.js";import{e as C}from"./chunk-Q54LOR4S.js";import{a as A,d as E}from"./chunk-NUSNMQPL.js";import{f as y}from"./chunk-5AK4OGCO.js";import{f as k,h as R,k as $}from"./chunk-TTYO2XJO.js";import{d as m,e as w,f as h,j as v}from"./chunk-PLJNPQFC.js";import{a as P}from"./chunk-HPPFA3XU.js";import{a as g,b as p,c as j}from"./chunk-DQAEQEXD.js";import{t as N}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var S=r=>A(async t=>{try{let s=await y(r.registrySource,{local:r.local}),a=s.recipes.filter(n=>n.scale==="project"),o=a.find(n=>n.name===r.templateName);if(o===void 0)return p({_tag:"TemplateNotFound",message:`Template '${r.templateName}' not found. Available: ${a.map(n=>n.name).join(", ")}`});await N.fs.mkdir(r.targetDir,{recursive:!0});let f={project_name:r.projectName,...r.variables},e=await C(o,{cwd:r.targetDir,registryUrl:s.registryUrl,force:!0,variables:f}),u=await b(r.targetDir),d=D(o,u);t.out.writeln(h(`\u2713 Created ${r.projectName} with ${e.written.length} file(s)`));for(let n of e.written)t.out.writeln(` \u2192 ${n}`);if(d.instructions.length>0){t.out.writeln(m(`
|
|
2
|
+
Next steps:`)),t.out.writeln(m(` cd ${r.projectName}`));for(let n of d.instructions)t.out.writeln(m(` ${n}`))}return g({template:o,result:e,depInfo:d})}catch(s){let a=s instanceof Error?s.message:String(s);return p({_tag:"ApplyError",message:a})}});var B=async r=>{let t=P(r??[],{string:["name","registry","var"],boolean:["local"],collect:["var"]}),s=t._[0],a=t.name??s,o=t.registry,f=t.local===!0,e=k({renderer:$.ansi(),sink:R.stdout()}),u={};for(let c of t.var){let[i,...l]=String(c).split("=");i!==void 0&&i!==""&&(u[i]=l.join("="))}if(s===void 0){try{let i=(await y(o,{local:f})).recipes.filter(l=>l.scale==="project");e.writeln("Usage: eser kit new <template> [--name <project-name>] [--var key=value]"),e.writeln(),e.writeln("Available project templates:"),e.writeln();for(let l of i)e.writeln(` ${l.name.padEnd(20)} ${l.description} `,m(`[${l.language}]`))}catch(c){let i=c instanceof Error?c.message:String(c);e.writeln(w(`Error: ${i}`))}return await e.close(),g(void 0)}if(a===void 0)return e.writeln(w("Project name is required.")),await e.close(),p({exitCode:1});e.writeln(v(`
|
|
3
|
+
Creating ${a} from ${s}...
|
|
4
|
+
`));let d=`${Deno.cwd()}/${a}`,n=await E(S({templateName:s,projectName:a,targetDir:d,registrySource:o,local:f,variables:u}),{out:e});return await e.close(),j(n)?g(void 0):p({exitCode:1})};export{B as main};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as f}from"./chunk-Z4WPWVC7.js";import{b as O,c as g,d as E}from"./chunk-BK2BDHKB.js";import{a as k,c as _,d as I,f as q}from"./chunk-LXVBR775.js";import{c as y,d as x,e as D,f as S,i as v,k as C}from"./chunk-NT2MQK7O.js";import{a as m,b as h}from"./chunk-DQAEQEXD.js";import{t as l}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var B=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],u=t=>B.map(n=>({...n,extras:O(t,n.id)})),p=(t,n)=>{let s=new Set(n.map(r=>r.questionId));for(let r of t)if(!s.has(r.id))return r;return null},R=t=>{let n=new Set(t.map(s=>s.questionId));return B.every(s=>n.has(s.id))};var w=(t,n,s)=>{switch(t.phase){case"IDLE":return b();case"DISCOVERY":return $(t,n,s);case"SPEC_DRAFT":return W(t);case"SPEC_APPROVED":case"BUILDING":return U(t,n,s);case"BLOCKED":return G(t);case"DONE":return V(t);default:return b()}},b=()=>({phase:"IDLE",instruction:'No active spec. Start one with: noskills spec new "description"'}),$=(t,n,s)=>{let r=u(n),e=p(r,t.discovery.answers);if(e===null)return{phase:"DISCOVERY",instruction:"All discovery questions answered. Run: noskills approve",question:{id:"",text:"",concerns:[],extras:[]},context:{rules:s,concernReminders:[]},transition:{onComplete:"noskills approve",remainingQuestions:0}};let o=t.discovery.answers.length,i=r.length;return{phase:"DISCOVERY",instruction:"Ask the user the following question and relay their answer.",question:{id:e.id,text:e.text,concerns:[...e.concerns],extras:e.extras.map(c=>c.text)},context:{rules:s,concernReminders:g(n)},transition:{onComplete:'noskills next --answer="..."',remainingQuestions:i-o-1}}},W=t=>({phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:t.specState.path??"",transition:{onApprove:"noskills approve"}}),U=(t,n,s)=>{let r=E(n),e={phase:"BUILDING",instruction:"Read the spec and implement the next task. Report progress when done.",context:{rules:s,concernReminders:g(n)},transition:{onComplete:'noskills next --answer="..."',onBlocked:'noskills block "reason"',iteration:t.building.iteration}};return r.length>0?{...e,concernTensions:r}:e},G=t=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:t.building.lastProgress??"Unknown",transition:{onResolved:'noskills next --answer="..."'}}),V=t=>({phase:"DONE",summary:{spec:t.spec,iterations:t.building.iteration,decisionsCount:t.decisions.length}});var A=(t,n,s,r)=>{let e=[];e.push(`# Spec: ${t}`),e.push(""),e.push("## Status: draft"),e.push(""),s.length>0&&(e.push(`## Concerns: ${s.map(o=>o.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let o of n)e.push(`### ${o.questionId}`),e.push(""),e.push(o.answer),e.push("");for(let o of s)if(o.specSections.length>0)for(let i of o.specSections)e.push(`## ${i} (${o.id})`),e.push(""),e.push("_To be filled in during implementation._"),e.push("");if(r.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let o=0;o<r.length;o++){let i=r[o];e.push(`| ${o+1} | ${i.question} | ${i.choice} | ${i.promoted?"yes":"no"} |`)}e.push("")}return e.push("## Tasks"),e.push(""),e.push("_To be generated from discovery answers._"),e.push(""),e.push("## Verification"),e.push(""),e.push("_To be defined based on discovery answers._"),e.push(""),e.join(`
|
|
2
|
+
`)};var Q=async(t,n,s)=>{if(n.spec===null)throw new Error("No active spec");let r=`${t}/${y.specDir(n.spec)}`,e=`${t}/${y.specFile(n.spec)}`;await l.fs.mkdir(r,{recursive:!0});let o=A(n.spec,n.discovery.answers,s,n.decisions);return await l.fs.writeTextFile(e,o),e};var ne=async t=>{let n=l.process.cwd();if(!await C(n)){let a=JSON.stringify({error:"noskills not initialized. Run: noskills init"});return await d(a),h({exitCode:1})}let s=null;if(t!==void 0)for(let a of t)a.startsWith("--answer=")&&(s=a.slice(9));let r=await x(n),e=await S(n);if(e===null){let a=JSON.stringify({error:"No config found"});return await d(a),h({exitCode:1})}let i=(await v(n)).filter(a=>e.concerns.includes(a.id));if(s!==null){let a=await z(n,r,e,i,s);await D(n,a);let F=await f(n),P=w(a,i,F);return await d(JSON.stringify(P,null,2)),m(void 0)}let c=await f(n),T=w(r,i,c);return await d(JSON.stringify(T,null,2)),m(void 0)},z=async(t,n,s,r,e)=>{switch(n.phase){case"DISCOVERY":{let o=u(r),i=p(o,n.discovery.answers);if(i===null)return n;let c=_(n,i.id,e);return R(c.discovery.answers)&&(c=I(c),await Q(t,c,r)),c}case"BUILDING":return q(n,e);case"BLOCKED":return k(n,"BUILDING");default:return n}},d=async t=>{let n=new TextEncoder,s=l.process.stdout.getWriter();await s.write(n.encode(t+`
|
|
3
|
+
`)),s.releaseLock()};export{ne as main};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as F}from"./chunk-
|
|
1
|
+
import{b as F}from"./chunk-T7K64JD5.js";import{b as v,d as E}from"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";import*as s from"node:fs/promises";import*as x from"node:fs";import*as i from"node:path";import*as g from"node:os";import*as b from"node:child_process";import d from"node:process";import{Buffer as w}from"node:buffer";import{Readable as k,Writable as O}from"node:stream";var S={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!1},R=()=>{let n=e=>({isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:e.isSymbolicLink(),size:e.size,mtime:e.mtime,atime:e.atime,birthtime:e.birthtime}),a=(e,t)=>{throw e instanceof Error&&"code"in e&&e.code==="ENOENT"?new v(t):e};return{async readFile(e,t){try{let r=await s.readFile(e,{signal:t?.signal});return new Uint8Array(r)}catch(r){return a(r,e)}},async readTextFile(e,t){try{return await s.readFile(e,{encoding:"utf-8",signal:t?.signal})}catch(r){return a(r,e)}},async writeFile(e,t,r){let c=r?.append?"a":"w";await s.writeFile(e,t,{signal:r?.signal,mode:r?.mode,flag:c})},async writeTextFile(e,t,r){let c=r?.append?"a":"w";await s.writeFile(e,t,{encoding:"utf-8",signal:r?.signal,mode:r?.mode,flag:c})},async exists(e){try{return await s.access(e),!0}catch{return!1}},async stat(e){try{let t=await s.stat(e);return n(t)}catch(t){return a(t,e)}},async lstat(e){try{let t=await s.lstat(e);return n(t)}catch(t){return a(t,e)}},async mkdir(e,t){await s.mkdir(e,{recursive:t?.recursive??!1,mode:t?.mode})},async ensureDir(e){await s.mkdir(e,{recursive:!0})},async remove(e,t){try{await s.rm(e,{recursive:t?.recursive??!1,force:!1})}catch(r){a(r,e)}},async*readDir(e){try{let t=await s.readdir(e,{withFileTypes:!0});for(let r of t)yield{name:r.name,isFile:r.isFile(),isDirectory:r.isDirectory(),isSymlink:r.isSymbolicLink()}}catch(t){a(t,e)}},async copyFile(e,t){await s.copyFile(e,t)},async rename(e,t){await s.rename(e,t)},async makeTempDir(e){let t=e?.dir??g.tmpdir(),r=e?.prefix??"",c=e?.suffix??"",u=await s.mkdtemp(i.join(t,r));if(c){let o=u+c;return await s.rename(u,o),o}return u},async realPath(e){try{return await s.realpath(e)}catch(t){throw t instanceof Error&&"code"in t&&t.code==="ENOENT"?new v(e):t}},watch(e,t){let r=t?.recursive??!0,c=[],u=[],o=[],l=!1,P=m=>{l||(o.length>0?o.shift()({value:m,done:!1}):u.push(m))};for(let m of e)try{let f=x.watch(m,{recursive:r},(h,y)=>{y!==null&&P({kind:h==="rename"?"create":"modify",paths:[i.join(m,y)]})});c.push(f)}catch{}return{close:()=>{l=!0;for(let m of c)m.close();for(let m of o)m({value:void 0,done:!0});o=[]},[Symbol.asyncIterator]:()=>({next:()=>l?Promise.resolve({value:void 0,done:!0}):u.length>0?Promise.resolve({value:u.shift(),done:!1}):new Promise(m=>{o.push(m)})})}},async chmod(e,t){await s.chmod(e,t)},async*walk(e,t){let r=t?.includeDirs??!0,c=t?.includeFiles??!0,u=t?.exts,o=t?.skip,l=async function*(P){let m=await s.readdir(P,{withFileTypes:!0});for(let f of m){let h=i.join(P,f.name);if(o?.some(p=>p.test(h)))continue;let y=f.isSymbolicLink();if(f.isDirectory())r&&(yield{path:h,name:f.name,isFile:!1,isDirectory:!0,isSymlink:y}),yield*l(h);else if(f.isFile()||y){if(!c||u&&!u.some(p=>f.name.endsWith(p.startsWith(".")?p:`.${p}`)))continue;yield{path:h,name:f.name,isFile:f.isFile(),isDirectory:!1,isSymlink:y}}}};yield*l(e)}}},W=()=>({join:i.join,resolve:i.resolve,dirname:i.dirname,basename:i.basename,extname:i.extname,normalize:i.normalize,isAbsolute:i.isAbsolute,relative:i.relative,parse:i.parse,format:i.format,sep:i.sep,delimiter:i.delimiter}),A=()=>({spawn(n,a=[],e){return new Promise((t,r)=>{let c=b.spawn(n,a,{cwd:e?.cwd,env:e?.env?{...d.env,...e.env}:void 0,stdio:F(e),signal:e?.signal}),u=[],o=[];c.stdout?.on("data",l=>u.push(l)),c.stderr?.on("data",l=>o.push(l)),c.on("error",r),c.on("close",l=>{t({success:l===0,code:l??1,stdout:new Uint8Array(w.concat(u)),stderr:new Uint8Array(w.concat(o))})})})},async exec(n,a=[],e){let t=await this.spawn(n,a,e);if(!t.success){let r=new TextDecoder().decode(t.stderr);throw new E(n,t.code,r)}return new TextDecoder().decode(t.stdout).trim()},async execJson(n,a=[],e){let t=await this.exec(n,a,e);return JSON.parse(t)},spawnChild(n,a=[],e){let t=b.spawn(n,a,{cwd:e?.cwd,env:e?.env?{...d.env,...e.env}:void 0,stdio:F(e),signal:e?.signal}),r=[],c=[];t.stdout?.on("data",o=>r.push(o)),t.stderr?.on("data",o=>c.push(o));let u=new Promise((o,l)=>{t.on("error",l),t.on("close",(P,m)=>{o({success:P===0,code:P??1,signal:m??void 0})})});return{pid:t.pid,stdin:t.stdin?O.toWeb(t.stdin):null,stdout:t.stdout?k.toWeb(t.stdout):null,stderr:t.stderr?k.toWeb(t.stderr):null,status:u,output:async()=>{let o=await u;return{success:o.success,code:o.code,stdout:new Uint8Array(w.concat(r)),stderr:new Uint8Array(w.concat(c))}},kill:o=>{t.kill(o)}}}}),D=()=>({get(n){return d.env[n]},set(n,a){d.env[n]=a},delete(n){delete d.env[n]},has(n){return n in d.env},toObject(){let n={};for(let[a,e]of Object.entries(d.env))e!==void 0&&(n[a]=e);return n}}),C=()=>({exit(n){d.exit(n)},setExitCode(n){d.exitCode=n},cwd(){return d.cwd()},chdir(n){d.chdir(n)},hostname(){return g.hostname()},execPath(){return d.execPath},args:d.argv.slice(2),pid:d.pid,stdin:k.toWeb(d.stdin),stdout:O.toWeb(d.stdout),stderr:O.toWeb(d.stderr)}),j=()=>{let n=R(),a=W(),e=A(),t=D(),r=C();return{name:"node",version:d.versions.node,capabilities:S,fs:n,path:a,exec:e,env:t,process:r}};export{S as NODE_CAPABILITIES,j as createNodeRuntime};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-QIYWONJL.js";import"./chunk-3K42AALS.js";import"./chunk-OLM5RTFK.js";import"./chunk-BCHXUKWW.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{a as OllamaModel,b as ollamaFactory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-AAV7D6DF.js";import"./chunk-3K42AALS.js";import"./chunk-OLM5RTFK.js";import"./chunk-BCHXUKWW.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{a as OpenCodeModel,b as openCodeFactory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f}from"./chunk-Q54LOR4S.js";import"./chunk-5AK4OGCO.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{e as applyRecipe,f as applyRecipeChain,b as fileExists,a as isPathSafe,c as processContent,d as runPostInstall};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j}from"./chunk-5AK4OGCO.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{b as DEFAULT_REGISTRY_URL,a as FETCH_TIMEOUT_MS,c as LOCAL_REGISTRY_PATH,e as detectLocalRegistry,g as fetchRecipeFile,i as fetchRecipeFolder,j as fetchRecipeFromRepo,f as fetchRegistry,h as parseGitHubRawUrl,d as registryFetch};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-RBB5ITAS.js";import"./chunk-V2N5L24J.js";import"./chunk-Y6DZEK4W.js";import"./chunk-34GCQZ3Z.js";import"./chunk-3APERFKY.js";import{a as g}from"./chunk-6U2VEZEM.js";import{a as C,b as v}from"./chunk-KAEAT6A4.js";import"./chunk-ZH37DSUQ.js";import"./chunk-LOFP256P.js";import"./chunk-ZF2XYULB.js";import"./chunk-4S7QYPS6.js";import{f as w}from"./chunk-NUSNMQPL.js";import"./chunk-GXPLME3K.js";import"./chunk-2J2PXBOC.js";import"./chunk-TTYO2XJO.js";import"./chunk-USCAYIWL.js";import{b as n,e as h,f,g as y,h as o}from"./chunk-PLJNPQFC.js";import{b as l}from"./chunk-BCHXUKWW.js";import{a as m}from"./chunk-HPPFA3XU.js";import{g as i}from"./chunk-DQAEQEXD.js";import"./chunk-WUJUQPHI.js";import"./chunk-A2GDVOQP.js";import"./chunk-GLSCZGXA.js";import"./chunk-ZE5T64HQ.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var t=C(),A=async()=>(await l`git status --porcelain`.noThrow().text()).length===0,b=async()=>{let e=await l`git log @{u}..HEAD --oneline`.noThrow().text();return e.length>0?e.split(`
|
|
2
2
|
`):[]},P=async(e,s)=>{for(let r of s)await l`git add ${r}`.spawn();await l`git commit -m ${e}`.spawn()},O=async()=>{await l`git push origin HEAD`.spawn()},k=async e=>{await l`git tag -d ${e}`.noThrow().spawn();let s=`:refs/tags/${e}`;await l`git push origin ${s}`.noThrow().spawn()},T=async e=>{let s=new TextEncoder,r=new TextDecoder,a=new Uint8Array(256);await Deno.stderr.write(s.encode(`${e} [y/N] `));let p=await Deno.stdin.read(a),d=r.decode(a.subarray(0,p??0)).trim();return d==="y"||d==="Y"},M=async e=>{let{type:s,dryRun:r=!1}=e;if(!await A())throw new Error("Working tree is dirty. Commit or stash changes first.");let a=await b();if(a.length>0&&e.yes!==!0)throw new Error(`You have ${a.length} unpushed commit(s):
|
|
3
3
|
${a.join(`
|
|
4
4
|
`)}
|
|
5
5
|
|
|
6
|
-
Push first, or re-run with --yes to continue anyway.`);let p=await c()??"0.0.0";s!=="same"&&await(await import("./versions-
|
|
6
|
+
Push first, or re-run with --yes to continue anyway.`);let p=await c()??"0.0.0";s!=="same"&&await(await import("./versions-KW5UTMNV.js")).versions(s,{dryRun:r});let d=await c()??p,u=!1;try{await(await import("./changelog-gen-QDUA5G5K.js")).generateChangelog({dryRun:r}),u=!0}catch{u=!1}let x=!1,E=!1;if(!r){u&&await l`deno fmt CHANGELOG.md`.noThrow().spawn();let R=["VERSION","CHANGELOG.md","pkg/*/deno.json","pkg/*/package.json","package.json"],$=`chore(codebase): release v${d}`;await P($,R),x=!0,await O(),E=!0}return{version:d,previousVersion:p,changelogGenerated:u,committed:x,pushed:E,dryRun:r}},U=async(e={})=>{let{dryRun:s=!1}=e;if(!await A())throw new Error("Working tree is dirty. Commit and push first.");let r=await b();if(r.length>0)throw new Error(`You have unpushed commits. Push first, then rerelease.
|
|
7
7
|
${r.join(`
|
|
8
8
|
`)}`);let a=await c();if(a===void 0||!/^\d+\.\d+\.\d+$/.test(a))throw new Error(`Invalid or missing version in VERSION file: "${a}"`);let p=`v${a}`;if(!s){let d=`chore(codebase): release v${a}`;await l`git commit --allow-empty -m ${d}`.spawn(),await l`git push origin HEAD`.spawn()}return{version:a,tag:p,dryRun:s}},H=async(e={})=>{let s=await c();if(s===void 0||!/^\d+\.\d+\.\d+$/.test(s))throw new Error(`Invalid or missing version in VERSION file: "${s}"`);let r=`v${s}`;if(e.yes!==!0)throw new Error(`This will delete tag ${r} locally and remotely. Re-run with --yes to confirm.`);return await k(r),{version:s,tag:r,deleted:!0}},I=e=>w.fromPromise(()=>M(e)),V=e=>w.fromPromise(()=>U(e)),D=e=>w.fromPromise(()=>H(e)),j=e=>{let s=e.args[0];return s===void 0||!["patch","minor","major","same"].includes(s)?i.fail(g.adaptError("Usage: eser codebase release <patch|minor|major|same> [--dry-run] [--yes]")):i.ok({type:s,dryRun:e.flags["dry-run"]===!0,yes:e.flags.yes===!0})},N=e=>i.ok({dryRun:e.flags["dry-run"]===!0}),G=e=>i.ok({yes:e.flags.yes===!0}),S=e=>{if(i.isFail(e)){let r=e.error,a=r instanceof Error?r.message:r.message??String(r);return t.writeln(h("\u2717"),n(" "+a)),i.fail({exitCode:1})}let{value:s}=e;return s.dryRun?(t.writeln(y("\u26A0"),n(" [DRY RUN] Release preview:")),t.writeln(o("\u2139"),n(` Version: ${s.previousVersion} -> ${s.version}`)),t.writeln(o("\u2139"),n(` Changelog: ${s.changelogGenerated?"generated":"no user-facing changes"}`)),t.writeln(o("\u2139"),n(" No changes were made."))):(t.writeln(f("\u2713"),n(` Released v${s.version}`)),t.writeln(o("\u2139"),n(` Version: ${s.previousVersion} -> ${s.version}`)),t.writeln(o("\u2139"),n(` Changelog: ${s.changelogGenerated?"updated":"no user-facing changes"}`)),t.writeln(o("\u2139"),n(` Committed: ${s.committed}`)),t.writeln(o("\u2139"),n(` Pushed: ${s.pushed}`)),t.writeln(o("\u2139"),n(" CI will validate, tag, and publish.")),t.writeln(o("\u2139"),n(" Watch: https://github.com/eser/stack/actions"))),i.ok(void 0)},Y=e=>{if(i.isFail(e)){let r=e.error,a=r instanceof Error?r.message:r.message??String(r);return t.writeln(h("\u2717"),n(" "+a)),i.fail({exitCode:1})}let{value:s}=e;return s.dryRun?t.writeln(y("\u26A0"),n(` [DRY RUN] Would delete and recreate tag ${s.tag}`)):(t.writeln(f("\u2713"),n(` Re-tagged ${s.tag}`)),t.writeln(o("\u2139"),n(" CI will validate and publish."))),i.ok(void 0)},F=e=>{if(i.isFail(e)){let r=e.error,a=r instanceof Error?r.message:r.message??String(r);return t.writeln(h("\u2717"),n(" "+a)),i.fail({exitCode:1})}let{value:s}=e;return s.deleted&&t.writeln(f("\u2713"),n(` Deleted tag v${s.version} (local + remote).`)),i.ok(void 0)},W=g.createTrigger({handler:I,adaptInput:j,adaptOutput:S}),L=g.createTrigger({handler:V,adaptInput:N,adaptOutput:Y}),B=g.createTrigger({handler:D,adaptInput:G,adaptOutput:F}),re=async e=>{let s=m(e??[],{boolean:["dry-run","yes"],alias:{n:"dry-run",y:"yes"}}),r=s._[0],a=s["dry-run"]===!0,p=s.yes===!0;if(r!==void 0&&!a&&!p&&["patch","minor","major","same"].includes(r)){let u=await c()??"0.0.0";if(t.writeln(o("\u2139"),n(` Current version: ${u}`)),t.writeln(o("\u2139"),n(` Bump type: ${r}`)),t.writeln(o("\u2139"),n(" This will bump version, generate changelog, commit, and push.")),await t.flush(),!await T("Proceed?"))return t.writeln(y("\u26A0"),n(" Aborted.")),i.ok(void 0);s.yes=!0}let d=v("release",s);return await W(d)},ne=async e=>{let s=m(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),r=v("rerelease",s);return await L(r)},te=async e=>{let s=m(e??[],{boolean:["yes"],alias:{y:"yes"}}),r=v("unrelease",s);return await B(r)};export{W as handleReleaseCli,L as handleRereleaseCli,B as handleUnreleaseCli,re as main,M as release,I as releaseHandler,U as rerelease,V as rereleaseHandler,ne as rereleaseMain,H as unrelease,D as unreleaseHandler,te as unreleaseMain};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import"./chunk-DDLQMSA7.js";import{a as y}from"./chunk-6U2VEZEM.js";import{a as E,b as A}from"./chunk-KAEAT6A4.js";import"./chunk-ZH37DSUQ.js";import"./chunk-LOFP256P.js";import"./chunk-ZF2XYULB.js";import"./chunk-4S7QYPS6.js";import{f as $}from"./chunk-NUSNMQPL.js";import"./chunk-2J2PXBOC.js";import"./chunk-TTYO2XJO.js";import"./chunk-USCAYIWL.js";import{b as p,e as P,f as m,g as C}from"./chunk-PLJNPQFC.js";import{c as u}from"./chunk-BCHXUKWW.js";import"./chunk-ZOZYBQX2.js";import"./chunk-UNL4H5EY.js";import"./chunk-DWYVBWBP.js";import{a as v}from"./chunk-HPPFA3XU.js";import{g as l}from"./chunk-DQAEQEXD.js";import"./chunk-WUJUQPHI.js";import"./chunk-A2GDVOQP.js";import{j as R,n as w}from"./chunk-GLSCZGXA.js";import"./chunk-ZE5T64HQ.js";import{v as c}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var h=E(),O=/^##\s{1,100}\[?([^\]\s]+)\]?\s{0,100}-?\s{0,100}([0-9]{4}-[0-9]{2}-[0-9]{2})?\s{0,100}$/,T=t=>{let e=t.trim().replace(/^refs\/tags\//,"");return e.startsWith("v")?e:`v${e}`},k=t=>{let e=t.split(/\r?\n/),r=[];for(let s=0;s<e.length;s+=1){let i=e[s].match(O);i!==null&&/^\d/.test(i[1])&&r.push({version:i[1],date:i[2]??"",headingLineIndex:s})}return r.length===0?[]:r.map((s,o)=>{let i=r[o+1],g=s.headingLineIndex+1,a=i!==void 0?i.headingLineIndex:e.length,n=e.slice(g,a);for(;n.length>0&&n[0].trim()==="";)n.shift();for(;n.length>0&&n[n.length-1].trim()==="";)n.pop();let d=[`## ${s.version}${s.date!==""?` - ${s.date}`:""}`];return n.length>0&&d.push("",...n),{version:s.version,date:s.date,tag:`v${s.version}`,notes:`${d.join(`
|
|
2
|
+
`).trim()}
|
|
3
|
+
`}})},I=async(t={})=>{let{changelogPath:e="CHANGELOG.md",root:r="."}=t,s=w(r,e),o=await c.runtime.fs.readTextFile(s);return{entries:k(o)}},S=async(t,e)=>{try{return await u.exec`gh release view ${t} --repo ${e}`.quiet().text(),!0}catch{return!1}},b=async t=>{let{repo:e,createIfMissing:r=!1,changelogPath:s="CHANGELOG.md",root:o=".",releaseTitle:i="eserstack {tag}"}=t,{entries:g}=await I({changelogPath:s,root:o});if(g.length===0)throw new Error("No release headings found in CHANGELOG.md.");let a=t.tag!==void 0?T(t.tag):g[0].tag,n=g.find(x=>x.tag===a);if(n===void 0)throw new Error(`No matching changelog section found for ${a}.`);let d=await c.runtime.fs.makeTempDir({prefix:"eserstack-release-"}),f=R(d,`${a}-notes.md`);await c.runtime.fs.writeTextFile(f,n.notes);try{if(await S(a,e))return await u.exec`gh release edit ${a} --repo ${e} --notes-file ${f}`.spawn(),{tag:a,entry:n,action:"updated"};if(!r)return{tag:a,entry:n,action:"skipped"};let N=i.replace("{tag}",a);try{return await u.exec`gh release create ${a} --repo ${e} --title ${N} --notes-file ${f}`.spawn(),{tag:a,entry:n,action:"created"}}catch{return await u.exec`gh release edit ${a} --repo ${e} --notes-file ${f}`.spawn(),{tag:a,entry:n,action:"updated"}}}finally{await c.runtime.fs.remove(d,{recursive:!0})}},G=t=>$.fromPromise(()=>b(t)),H=t=>{let e=t.flags.repo??c.runtime.env.get("GITHUB_REPOSITORY")??"";return e===""?l.fail(y.adaptError("Missing repository. Pass --repo or set GITHUB_REPOSITORY.")):l.ok({repo:e,tag:t.flags.tag??void 0,createIfMissing:t.flags["create-if-missing"]===!0})},L=t=>{if(l.isFail(t)){let r=t.error,s=r instanceof Error?r.message:r.message??String(r);return h.writeln(P("\u2717"),p(" "+s)),l.fail({exitCode:1})}let{value:e}=t;switch(e.action){case"created":h.writeln(m("\u2713"),p(` Created release ${e.tag} with changelog notes.`));break;case"updated":h.writeln(m("\u2713"),p(` Updated release notes for ${e.tag}.`));break;case"skipped":h.writeln(C("\u26A0"),p(` Release ${e.tag} not found. Skipping (pass --create-if-missing to create).`));break}return l.ok(void 0)},M=y.createTrigger({handler:G,adaptInput:H,adaptOutput:L}),W=async t=>{let e=v(t??[],{string:["repo","tag"],boolean:["create-if-missing"],alias:{h:"help"}}),r=A("release-notes",e);return await M(r)};export{M as handleCli,S as hasGitHubRelease,W as main,T as normalizeTag,I as parseChangelog,k as parseChangelogText,b as syncReleaseNotes,G as syncReleaseNotesHandler};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as y,d as v}from"./chunk-C3PZVQ3Z.js";import{a as P}from"./chunk-RBB5ITAS.js";import"./chunk-V2N5L24J.js";import"./chunk-Y6DZEK4W.js";import"./chunk-34GCQZ3Z.js";import"./chunk-3APERFKY.js";import{a as h}from"./chunk-6U2VEZEM.js";import{a as f,b as R}from"./chunk-KAEAT6A4.js";import"./chunk-ZH37DSUQ.js";import"./chunk-LOFP256P.js";import"./chunk-ZF2XYULB.js";import"./chunk-4S7QYPS6.js";import{f as c}from"./chunk-NUSNMQPL.js";import"./chunk-GXPLME3K.js";import"./chunk-2J2PXBOC.js";import"./chunk-TTYO2XJO.js";import"./chunk-USCAYIWL.js";import{b as a,e as g,f as u,g as d,h as m}from"./chunk-PLJNPQFC.js";import"./chunk-BCHXUKWW.js";import{a as p}from"./chunk-HPPFA3XU.js";import{g as t}from"./chunk-DQAEQEXD.js";import"./chunk-WUJUQPHI.js";import"./chunk-A2GDVOQP.js";import"./chunk-GLSCZGXA.js";import"./chunk-ZE5T64HQ.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var o=f(),C=async(e={})=>{let{root:r=".",remote:n="origin",tagPrefix:T="v",messageTemplate:x="Release {tag}",dryRun:l=!1}=e,s=await P({root:r});if(s===void 0||!/^\d+\.\d+\.\d+$/.test(s))throw new Error(`Invalid or missing version in VERSION file: "${s}"`);let i=`${T}${s}`,w=x.replace("{tag}",i).replace("{version}",s);return l||(await y(i,w),await v(n,i)),{version:s,tag:i,remote:n,dryRun:l}},A=e=>c.fromPromise(()=>C(e)),E=e=>t.ok({dryRun:e.flags["dry-run"]===!0}),$=e=>{if(t.isFail(e))return o.writeln(g("\u2717"),a(" "+(e.error instanceof Error?e.error.message:String(e.error)))),t.fail({exitCode:1});let{value:r}=e;return r.dryRun?o.writeln(d("\u26A0"),a(` [DRY RUN] Would create and push tag ${r.tag}`)):(o.writeln(u("\u2713"),a(` Created tag ${r.tag}`)),o.writeln(m("\u2139"),a(` Pushed tag ${r.tag} to ${r.remote}`))),t.ok(void 0)},O=h.createTrigger({handler:A,adaptInput:E,adaptOutput:$}),U=async e=>{let r=p(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),n=R("release-tag",r);return await O(n)};export{O as handleCli,U as main,C as pushReleaseTag,A as pushReleaseTagHandler};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as u}from"./chunk-LXVBR775.js";import{d as c,e as d}from"./chunk-NT2MQK7O.js";import{f as m,h as p,k as l}from"./chunk-TTYO2XJO.js";import{d as a,f as o}from"./chunk-PLJNPQFC.js";import{a as r}from"./chunk-DQAEQEXD.js";import{t as i}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var N=async w=>{let e=m({renderer:l.ansi(),sink:p.stdout()}),n=i.process.cwd(),s=await c(n);if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(a("Already idle. Nothing to reset.")),await e.close(),r(void 0);let t=s.spec,f=u(s);return await d(n,f),e.writeln(o("\u2714")," Reset to IDLE."),t!==null&&e.writeln(a(`Spec "${t}" state cleared. Files in .nos/specs/${t}/ preserved.`)),await e.close(),r(void 0)};export{N as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as h,b as k}from"./chunk-Z4WPWVC7.js";import{c as f,f as g}from"./chunk-NT2MQK7O.js";import{f as o,h as l,k as a}from"./chunk-TTYO2XJO.js";import{c as m,d as n,e as p,f as w}from"./chunk-PLJNPQFC.js";import{a as d,b as c}from"./chunk-DQAEQEXD.js";import{t as i}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var j=async s=>{let e=s?.[0];if(e==="add")return await y(s?.slice(1));if(e==="list")return await A();if(e==="promote")return await C(s?.slice(1));let t=o({renderer:a.ansi(),sink:l.stdout()});return t.writeln('Usage: noskills rule <add "rule text" | list | promote "decision">'),await t.close(),d(void 0)},y=async s=>{let e=o({renderer:a.ansi(),sink:l.stdout()}),t=i.process.cwd(),r=s?.join(" ");if(r===void 0||r.length===0)return e.writeln(p("Please provide a rule: "),m('noskills rule add "Use Vitest for all tests"')),await e.close(),c({exitCode:1});let P=r.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),x=`${t}/${f.rulesDir}/${P}.md`;await i.fs.mkdir(`${t}/${f.rulesDir}`,{recursive:!0}),await i.fs.writeTextFile(x,r+`
|
|
2
|
+
`),e.writeln(w("\u2714")," Rule added: ",n(r));let u=await g(t);return u!==null&&u.tools.length>0&&(await k(t,u.tools),e.writeln(n(" Tool files synced."))),await e.close(),d(void 0)},A=async()=>{let s=o({renderer:a.ansi(),sink:l.stdout()}),e=i.process.cwd(),t=await h(e);if(s.writeln(m("Rules")),s.writeln(""),t.length===0)s.writeln(n(' No rules yet. Add one with: noskills rule add "..."'));else for(let r of t)s.writeln(" ",n("\u2022"),` ${r}`);return await s.close(),d(void 0)},C=async s=>{let e=o({renderer:a.ansi(),sink:l.stdout()}),t=s?.join(" ");return t===void 0||t.length===0?(e.writeln(p("Please provide the decision text to promote.")),await e.close(),c({exitCode:1})):(e.writeln(n("Promoting decision to rule...")),await e.close(),await y(s))};export{j as main};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as V,b as q,c as z}from"./chunk-
|
|
1
|
+
import{a as V,b as q,c as z}from"./chunk-MYSTBVWT.js";import"./chunk-3I4JG3PJ.js";import{a as A,c as J,d as k,e as L}from"./chunk-NUSNMQPL.js";import"./chunk-GXPLME3K.js";import{f as N,h as U,k as B}from"./chunk-TTYO2XJO.js";import{e as x,f as C,g as F}from"./chunk-PLJNPQFC.js";import{b as H}from"./chunk-BCHXUKWW.js";import{a as I}from"./chunk-HPPFA3XU.js";import{a as W,b as c,c as P,d as S}from"./chunk-DQAEQEXD.js";import{t as _}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var O=s=>({_tag:"WorkflowError",message:s}),Z=s=>{if(typeof s=="string")return{name:s,options:{},continueOnError:!1};let o=Object.entries(s);if(o.length!==1)throw new Error(`Invalid step config: expected exactly one key, got ${o.length}`);let[e,n]=o[0],r={},i=!1,l;for(let[a,t]of Object.entries(n))a==="continueOnError"?i=t===!0:a==="timeout"?l=t*1e3:r[a]=t;return{name:e,options:r,continueOnError:i,timeout:l}},ee=(s,o,e)=>L(J(s,n=>O(n instanceof Error?n.message:String(n))),o,O(`Step '${e}' timed out after ${(o/1e3).toFixed(0)}s`)),G=(s,o,e={})=>A(async()=>{let n=performance.now(),r=[],i=e.defaultTimeout??6e4;for(let a of s.steps){let t=Z(a);if(e.only!==void 0&&t.name!==e.only)continue;let T=o.get(t.name);if(T===void 0)return c(O(`Unknown tool '${t.name}' in workflow '${s.id}'. Registered tools: ${o.names().join(", ")||"(none)"}`));let v={...t.options,root:e.root??".",fix:e.fix??!1,_args:e.args??[]};e.changedFiles!==void 0&&(v._changedFiles=e.changedFiles),e.onStepStart?.(t.name);let g=performance.now(),j=t.timeout??i,h=ee(()=>T.run(v),j,t.name),p=await k(h),d;if(P(p))d=p.value;else if(t.continueOnError)d={name:t.name,passed:!1,issues:[{message:p.error.message}],mutations:[],stats:{}};else return p;let b=performance.now()-g,y={...d,durationMs:b};r.push(y),d.mutations.length>0&&e.onMutations!==void 0&&await e.onMutations(d.mutations),e.onStepEnd?.(y)}let l=performance.now()-n;return W({workflowId:s.id,passed:r.every(a=>a.passed),steps:r,totalDurationMs:l})}),D=(s,o,e=new Set)=>{if(s.includes===void 0||s.includes.length===0)return s;let n=new Set(e);n.add(s.id);let r=[];for(let i of s.includes){if(n.has(i))throw new Error(`Circular include detected: workflow '${s.id}' includes '${i}' which is already in the include chain: ${[...n].join(" \u2192 ")}`);let l=o.find(t=>t.id===i);if(l===void 0)throw new Error(`Workflow '${s.id}' includes '${i}' but no workflow with that id exists. Available: ${o.map(t=>t.id).join(", ")||"(none)"}`);let a=D(l,o,n);r.push(...a.steps)}return{...s,steps:[...r,...s.steps],includes:void 0}},K=(s,o,e,n={})=>A(async()=>{let r=o.workflows.find(l=>l.id===s);if(r===void 0)return c(O(`Workflow '${s}' not found. Available: ${o.workflows.map(l=>l.id).join(", ")||"(none)"}`));let i=D(r,o.workflows);return await k(G(i,e,n))}),Q=(s,o,e,n={})=>A(async()=>{let r=o.filter(l=>l.on.includes(s));if(r.length===0)return c(O(`No workflows found for event '${s}'. Available: ${o.map(l=>`${l.id} (${l.on.join(", ")})`).join("; ")||"(none)"}`));let i=[];for(let l of r){let a=D(l,o),t=await k(G(a,e,n));if(S(t))return t;i.push(t.value)}return W(i)});var oe=50,$=B.ansi(),se=(s,o,e)=>{let n=".".repeat(Math.max(1,oe-s.length)),r=`${(o.durationMs/1e3).toFixed(1)}s`,i;if(o.passed&&o.mutations.length>0)i=$.render([F(`Fixed (${o.mutations.length} file${o.mutations.length===1?"":"s"}, ${r})`)]);else if(o.passed)if(e&&Object.keys(o.stats).length>0){let l=Object.entries(o.stats).map(([a,t])=>`${t} ${a}`).join(", ");i=$.render([C(`Passed (${l}, ${r})`)])}else i=$.render([C(`Passed (${r})`)]);else i=$.render([x(`Failed (${r})`)]);return`${s}${n}${i}`},pe=async(s,o)=>{let e=I(s??[],{string:["event","workflow","only","config"],boolean:["fix","dry-run","help","verbose","json","changed"],alias:{e:"event",w:"workflow",h:"help",v:"verbose"}});if(e.help)return console.log(`eser workflows run \u2014 Run workflow pipelines
|
|
2
2
|
`),console.log("Usage:"),console.log(" eser workflows run -e <event> Run by event"),console.log(" eser workflows run -w <workflow-id> Run by workflow id"),console.log(),console.log("Options:"),console.log(" -e, --event <name> Event to trigger (precommit, commitmsg, prepush)"),console.log(" -w, --workflow <id> Workflow id to run"),console.log(" --fix Auto-fix issues where supported"),console.log(" --dry-run Preview mutations without writing"),console.log(" --only <step> Run only a specific step"),console.log(" --config <path> Config directory (default: .)"),console.log(" -v, --verbose Show stats and issues for all steps"),console.log(" --json Output results as JSON"),console.log(" --changed Only check files changed in git"),console.log(" -h, --help Show this help"),W(void 0);let n=N({renderer:$,sink:U.stdout()}),r=e.event,i=e.workflow,l=e.fix??!1,a=e["dry-run"]??!1,t=e.only,T=e._,v=e.verbose??!1,g=e.json??!1,j=e.changed??!1;if(r===void 0&&i===void 0)return console.error("Error: specify -e <event> or -w <workflow-id>. Use --help for usage."),await n.close(),c({exitCode:1});let h=V();h.register(z),o?.tools!==void 0&&h.registerAll(o.tools);let p=e.config??".",d=await q(p);if(d===null)return console.error("Error: no .manifest.yml found in current directory."),await n.close(),c({exitCode:1});let b;if(j)try{b=await H`git diff --name-only HEAD`.cwd(p).noThrow().lines()}catch{n.writeln(F("Warning: could not run git, running without file filtering."))}let y=[],M={root:p,fix:l,dryRun:a,only:t,args:T,changedFiles:b,onStepStart:void 0,onStepEnd:g?void 0:f=>{if(console.log(se(f.name,f,v)),!f.passed||v)for(let u of f.issues){let R=u.path!==void 0?u.line!==void 0?`${u.path}:${u.line}`:u.path:"";console.log(` ${$.render([x("\u2717")])} ${R}${R.length>0?": ":""}${u.message}`)}},onMutations:async f=>{if(!a)for(let u of f)u.oldContent!==u.newContent&&await _.fs.writeTextFile(u.path,u.newContent)}};try{let f=!0,u=0,R=0;if(r!==void 0){let w=await k(Q(r,d.workflows,h,M));if(S(w))throw new Error(w.error.message);for(let m of w.value){y.push(m),m.passed||(f=!1);for(let E of m.steps)E.passed||(R++,u+=E.issues.length)}}else{let w=await k(K(i,d,h,M));if(S(w))throw new Error(w.error.message);let m=w.value;y.push(m),f=m.passed;for(let E of m.steps)E.passed||(R++,u+=E.issues.length)}return g&&console.log(JSON.stringify(y,null,2)),f?(g||n.writeln(C(`
|
|
3
3
|
All checks passed!`)),await n.close(),W(void 0)):(g||n.writeln(x(`
|
|
4
4
|
${R} check(s) failed with ${u} issue(s)`)),await n.close(),c({exitCode:1}))}catch(f){return n.writeln(x(`Error: ${f instanceof Error?f.message:String(f)}`)),await n.close(),c({exitCode:1})}};export{pe as main};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as w,h as g,k as y}from"./chunk-
|
|
1
|
+
import{f as w,h as g,k as y}from"./chunk-TTYO2XJO.js";import{b as m,d as p,e as C}from"./chunk-PLJNPQFC.js";import{a as x}from"./chunk-BCHXUKWW.js";import{a as h,b as f}from"./chunk-DQAEQEXD.js";import{t as S}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var l=(e,r)=>typeof r=="string"?{command:r,description:e,workingDirectory:void 0,depends:[]}:{command:r.command,description:r.description??e,workingDirectory:r.workingDirectory,depends:r.depends??[]},k=(e,r,t=new Set,s=new Set)=>{if(s.has(e))return[];if(t.has(e))throw new Error(`Circular dependency detected: ${e} depends on itself (cycle in dependency chain)`);let n=r[e];if(n===void 0)throw new Error(`Unknown script dependency: "${e}"`);t.add(e);let c=l(e,n),o=[];for(let a of c.depends){let i=k(a,r,t,s);for(let d of i)s.has(d)||(o.push(d),s.add(d))}return s.add(e),o},P=()=>{let e=new URL("./main.ts",import.meta.url),r=e.protocol==="file:"?e.pathname:e.href;return`${S.process.execPath()} run --allow-all ${r}`},R=e=>{if(e==="eser"||e.startsWith("eser ")){let r=e.slice(4);return`${P()}${r}`}return e},$=async(e,r,t)=>{let s=R(e),n=t!==void 0&&t.length>0?`${s} ${t.join(" ")}`:s,c=r??".";return(await new x("sh",["-c",n]).cwd(c).stdout("inherit").stderr("inherit").noThrow().spawn()).code},O=async(e,r,t,s)=>{let n=w({renderer:y.ansi(),sink:g.stdout()}),c=k(e,t);for(let i of c){let d=l(i,t[i]);n.writeln(p(`$ ${i}`));let u=await $(d.command,d.workingDirectory);if(u!==0)return n.writeln(C(`Script dependency "${i}" failed with exit code ${u}`)),await n.close(),f({exitCode:u})}let o=l(e,t[e]);n.writeln(p(`$ ${e}`));let a=await $(o.command,o.workingDirectory,s);return a!==0?(await n.close(),f({exitCode:a})):(await n.close(),h(void 0))},B=e=>{let r=w({renderer:y.ansi(),sink:g.stdout()});r.writeln(m("Scripts:"));for(let[t,s]of Object.entries(e)){let n=l(t,s);r.writeln(m(` ${t.padEnd(20)} `),p(n.description))}r.writeln()};export{$ as executeCommand,l as parseScript,k as resolveDependencies,O as runScript,B as showScripts};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{f as l,h as a,k as i}from"./chunk-
|
|
1
|
+
import{f as l,h as a,k as i}from"./chunk-TTYO2XJO.js";import{j as n}from"./chunk-PLJNPQFC.js";import"./chunk-ZOZYBQX2.js";import{a as o}from"./chunk-DWYVBWBP.js";import"./chunk-HPPFA3XU.js";import{a as t}from"./chunk-DQAEQEXD.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var v=["trace","debug","info","warn","error","fatal"],P=async m=>{let{flags:e}=o(m??[],[{name:"port",short:"p",type:"number",default:8e3,description:"Server port"},{name:"log-level",type:"string",default:"info",description:"Log level"}]),r=l({renderer:i.ansi(),sink:a.stdout()});r.writeln(n(`
|
|
2
2
|
\u{1F680} Serving production build...
|
|
3
|
-
`));let p=e.port,s=e["log-level"]??"info",u=v.includes(s.toLowerCase())?s.toLowerCase():"info",[{startServer:g},{reactRenderer:c,reactHtmlShellBuilder:d},{reactPlugin:L},{createTailwindPlugin:f}]=await Promise.all([import("./main-
|
|
3
|
+
`));let p=e.port,s=e["log-level"]??"info",u=v.includes(s.toLowerCase())?s.toLowerCase():"info",[{startServer:g},{reactRenderer:c,reactHtmlShellBuilder:d},{reactPlugin:L},{createTailwindPlugin:f}]=await Promise.all([import("./main-FQFNY7SM.js"),import("./mod-VZPKQ7DG.js"),import("./mod-TLLZ3NAM.js"),import("./mod-U6LEXPVR.js")]);return await r.close(),await g({mode:"serve",port:p,logLevel:u,hmr:!1,renderer:c,htmlShell:d,frameworkPlugin:L,cssPlugin:f({globalCssPath:"src/app/styles/global.css"})}),t(void 0)};export{P as main};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as L,b as Y,h as G,i as O,m as K,o as A,p as D}from"./chunk-
|
|
1
|
+
import{a as L,b as Y,h as G,i as O,m as K,o as A,p as D}from"./chunk-ETMOOGY2.js";import{e as F}from"./chunk-OBIEQJDE.js";import"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import{t as f}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import{b as I}from"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";function q(e,s){let a={...e,...s},i=[];a.description&&i.push(`<meta name="description" content="${j(a.description)}">`),a.keywords&&a.keywords.length>0&&i.push(`<meta name="keywords" content="${j(a.keywords.join(", "))}">`),a.author&&i.push(`<meta name="author" content="${j(a.author)}">`),a.themeColor&&i.push(`<meta name="theme-color" content="${a.themeColor}">`);let n=[];return a.noIndex&&n.push("noindex"),a.noFollow&&n.push("nofollow"),n.length>0&&i.push(`<meta name="robots" content="${n.join(", ")}">`),a.canonicalUrl&&i.push(`<link rel="canonical" href="${j(a.canonicalUrl)}">`),i.push(`<meta property="og:type" content="${a.ogType||"website"}">`),i.push(`<meta property="og:title" content="${j(a.title)}">`),a.description&&i.push(`<meta property="og:description" content="${j(a.description)}">`),a.siteUrl&&i.push(`<meta property="og:url" content="${j(a.siteUrl)}">`),a.siteName&&i.push(`<meta property="og:site_name" content="${j(a.siteName)}">`),a.locale&&i.push(`<meta property="og:locale" content="${a.locale}">`),a.ogImage&&(i.push(`<meta property="og:image" content="${j(a.ogImage)}">`),i.push(`<meta property="og:image:alt" content="${j(a.title)}">`)),i.push('<meta name="twitter:card" content="summary_large_image">'),i.push(`<meta name="twitter:title" content="${j(a.title)}">`),a.description&&i.push(`<meta name="twitter:description" content="${j(a.description)}">`),a.twitterHandle&&(i.push(`<meta name="twitter:site" content="${j(a.twitterHandle)}">`),i.push(`<meta name="twitter:creator" content="${j(a.twitterHandle)}">`)),a.ogImage&&i.push(`<meta name="twitter:image" content="${j(a.ogImage)}">`),a.favicon&&i.push(`<link rel="icon" href="${j(a.favicon)}">`),i.join(`
|
|
2
2
|
`)}function M(e,s){let a={...e,...s},i={"@context":"https://schema.org","@type":"WebSite",name:a.siteName,url:a.siteUrl,description:a.description},n={"@context":"https://schema.org","@type":"Organization",name:a.siteName,url:a.siteUrl,logo:a.ogImage},t=[i,n];return a.jsonLd&&t.push({"@context":"https://schema.org",...a.jsonLd}),t.map(p=>`<script type="application/ld+json">${JSON.stringify(p)}</script>`).join(`
|
|
3
3
|
`)}function j(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var V={title:"laroux.js 3.0",description:"Zero-configuration React Server Components on Deno 2.x. Modern, simple, and built with cutting-edge technology.",siteName:"laroux.js",siteUrl:"https://laroux.now",locale:"en_US",themeColor:"#7c3aed",favicon:"/favicon.svg",twitterHandle:"@eser",ogImage:"https://laroux.now/og-image.png",ogType:"website",keywords:["laroux","open source","community","development","react","server components","server actions","island architecture"],author:"Eser Ozvataf"};function Q(e){let s=e.entrypoint??"/client.js",a=e.chunkManifest?.buildId?`?v=${e.chunkManifest.buildId}`:`?v=${Date.now()}`,i=e.chunkManifest?.hmrEnabled?"":a,n=e.fontPreloads?.join(`
|
|
4
4
|
`)??"",t=e.fontCSS?`<style>${e.fontCSS}</style>`:"",p=e.criticalChunks?.map(v=>`<link rel="modulepreload" href="${v}${a}">`).join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as D,h as $}from"./chunk-LXVBR775.js";import{c as k,d as y,e as b,k as C}from"./chunk-NT2MQK7O.js";import{f as u,h as w,k as f}from"./chunk-TTYO2XJO.js";import{c as i,d as n,e as m,f as h,g}from"./chunk-PLJNPQFC.js";import{a as p,b as d}from"./chunk-DQAEQEXD.js";import{t as l}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var z=async e=>{let s=e?.[0];if(s==="new")return await v(e?.slice(1));if(s==="list")return await N();let t=u({renderer:f.ansi(),sink:w.stdout()});return t.writeln('Usage: noskills spec <new "description" | list>'),await t.close(),p(void 0)},v=async e=>{let s=u({renderer:f.ansi(),sink:w.stdout()}),t=l.process.cwd();if(!await C(t))return s.writeln(m("noskills is not initialized.")," Run: ",i("noskills init")),await s.close(),d({exitCode:1});let a=e?.join(" ");if(a===void 0||a.length===0)return s.writeln(m("Please provide a description: "),i('noskills spec new "photo auto-listing"')),await s.close(),d({exitCode:1});let r=a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),c=`spec/${r}`,o=await y(t);if(o.phase!=="IDLE"&&o.phase!=="DONE")return s.writeln(m(`Cannot start new spec in phase: ${o.phase}`),n(" \u2014 finish or reset the current spec first.")),await s.close(),d({exitCode:1});let S=D(o.phase==="DONE"?$(o):o,r,c);return await l.fs.mkdir(`${t}/${k.specDir(r)}`,{recursive:!0}),await b(t,S),s.writeln(h("\u2714")," Spec started: ",i(r)),s.writeln(" Branch: ",n(c)),s.writeln(" Phase: ",g("DISCOVERY")),s.writeln(""),s.writeln("Run ",i("noskills next")," to begin discovery questions."),await s.close(),p(void 0)},N=async()=>{let e=u({renderer:f.ansi(),sink:w.stdout()}),t=`${l.process.cwd()}/${k.specsDir}`;e.writeln(i("Specs")),e.writeln("");try{let a=0;for await(let r of l.fs.readDir(t))if(r.isDirectory){let c=await l.fs.stat(`${t}/${r.name}/spec.md`).then(()=>!0).catch(()=>!1);e.writeln(" ",c?h("\u25CF"):n("\u25CB")," ",i(r.name),c?n(" spec.md"):n(" (no spec yet)")),a++}a===0&&e.writeln(n(" No specs yet."))}catch{e.writeln(n(" No specs directory."))}return await e.close(),p(void 0)};export{z as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as f,f as g,k as b}from"./chunk-NT2MQK7O.js";import{f as h,h as m,k as u}from"./chunk-TTYO2XJO.js";import{c as i,d as r,e as a,f as c,g as d,j as w}from"./chunk-PLJNPQFC.js";import{a as o,b as l}from"./chunk-DQAEQEXD.js";import{t as p}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var E=async D=>{let e=h({renderer:u.ansi(),sink:m.stdout()}),t=p.process.cwd();if(!await b(t))return e.writeln(a("noskills is not initialized.")," Run: ",i("noskills init")),await e.close(),l({exitCode:1});let s=await f(t),n=await g(t);e.writeln(i("noskills status")),e.writeln("");let y=s.phase==="DONE"?c(s.phase):s.phase==="BLOCKED"?a(s.phase):s.phase==="BUILDING"?w(s.phase):d(s.phase);if(e.writeln(" Phase: ",y),s.spec!==null&&e.writeln(" Spec: ",i(s.spec)),s.branch!==null&&e.writeln(" Branch: ",s.branch),s.phase==="DISCOVERY"){let C=s.discovery.answers.length;e.writeln(` Discovery: ${C}/6 questions answered`)}return s.phase==="BUILDING"&&(e.writeln(` Iteration: ${s.building.iteration}`),s.building.lastProgress!==null&&e.writeln(" Progress: ",r(s.building.lastProgress))),n!==null&&(e.writeln(""),n.concerns.length>0&&e.writeln(" Concerns: ",r(n.concerns.join(", "))),n.tools.length>0&&e.writeln(" Tools: ",r(n.tools.join(", ")))),s.decisions.length>0&&(e.writeln(""),e.writeln(` Decisions: ${s.decisions.length}`)),await e.close(),o(void 0)};export{E as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as g}from"./chunk-Z4WPWVC7.js";import{f as u}from"./chunk-NT2MQK7O.js";import{f as p,h as d,k as f}from"./chunk-TTYO2XJO.js";import{c as m,d as e,e as c,f as n}from"./chunk-PLJNPQFC.js";import{a as o,b as l}from"./chunk-DQAEQEXD.js";import{t as a}from"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var R=async y=>{let s=p({renderer:f.ansi(),sink:d.stdout()}),r=a.process.cwd(),t=await u(r);if(t===null)return s.writeln(c("noskills is not initialized.")," Run: ",m("noskills init")),await s.close(),l({exitCode:1});s.writeln(e("Syncing tool files..."));let i=await g(r,t.tools);for(let w of i)s.writeln(" ",n("\u2714"),` ${w}`);return i.length===0&&s.writeln(e(" No tools configured.")),s.writeln(""),s.writeln(n("Done.")),await s.close(),o(void 0)};export{R as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a,d as b,e as c,f as d}from"./chunk-3OEM65F2.js";import"./chunk-5RK3346P.js";import"./chunk-UKYKMDYU.js";import"./chunk-4H4O3TGK.js";import"./chunk-V2N5L24J.js";import"./chunk-Y6DZEK4W.js";import"./chunk-34GCQZ3Z.js";import"./chunk-3APERFKY.js";import"./chunk-GXPLME3K.js";import"./chunk-2J2PXBOC.js";import"./chunk-OBIEQJDE.js";import"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import"./chunk-BCHXUKWW.js";import"./chunk-GLSCZGXA.js";import"./chunk-ZE5T64HQ.js";import"./chunk-YXSB6RET.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{b as build,a as createBuildContext,c as ensureBuildIsReady,d as watch};
|