eser 4.1.34 → 4.1.36
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/{build-6DCIDFY7.js → build-EJLFNB4I.js} +2 -2
- package/chunks/{changelog-gen-7V37P7PE.js → changelog-gen-MX6L2Z24.js} +1 -1
- package/chunks/{chunk-NTHP6SND.js → chunk-2HBVIH7V.js} +1 -1
- package/chunks/{chunk-CEYKWASA.js → chunk-4MVO4LD5.js} +1 -1
- package/chunks/chunk-AHLJCH32.js +2 -0
- package/chunks/{chunk-COKZ6MLN.js → chunk-B6EATLKL.js} +3 -3
- package/chunks/{chunk-4GQY3STW.js → chunk-DAYSTLLV.js} +1 -1
- package/chunks/{chunk-4SYC4WJV.js → chunk-DYRTLYTU.js} +2 -2
- package/chunks/{chunk-VC6ERZSI.js → chunk-GJ4LCA6D.js} +1 -1
- package/chunks/{chunk-CLL3YG4W.js → chunk-IIIMOOFE.js} +1 -1
- package/chunks/{chunk-5PNGVDLV.js → chunk-IZONBJSX.js} +1 -1
- package/chunks/{chunk-AGRTWPDI.js → chunk-KBFKBL6A.js} +1 -1
- package/chunks/{chunk-KKBIUT5L.js → chunk-KVTG56GS.js} +1 -1
- package/chunks/{chunk-N4HITOTN.js → chunk-OCPEFZBJ.js} +1 -1
- package/chunks/{chunk-64PIAW3Y.js → chunk-OIZ7HL2C.js} +1 -1
- package/chunks/{chunk-SQINSLNL.js → chunk-PZNCE6QK.js} +19 -19
- package/chunks/{chunk-5BZG26SF.js → chunk-QSION3QA.js} +1 -1
- package/chunks/{chunk-3KCPUYLZ.js → chunk-QZ44TAIY.js} +1 -1
- package/chunks/{chunk-K7MYEXOS.js → chunk-T2DRBZ4X.js} +1 -1
- package/chunks/chunk-UJPVEQX7.js +5 -0
- package/chunks/chunk-VAIRJES2.js +2 -0
- package/chunks/{commitmsg-UK2ABB7D.js → commitmsg-7XZGGERO.js} +1 -1
- package/chunks/concern-ZO533WR2.js +2 -0
- package/chunks/{dev-XBH6C6DH.js → dev-PTMXZEVC.js} +2 -2
- package/chunks/{gh-RKKHKA3B.js → gh-L25JQWOY.js} +2 -2
- package/chunks/{gh-contributors-X7BW57DD.js → gh-contributors-E7IZ2LFS.js} +1 -1
- package/chunks/init-3B7XMH2J.js +2 -0
- package/chunks/{init-32DVDSNZ.js → init-J4IHOVZL.js} +2 -2
- package/chunks/{install-LM44N3DB.js → install-KNZDCGIB.js} +1 -1
- package/chunks/{invoke-hook-PADL4W3J.js → invoke-hook-I2T7HYRT.js} +1 -1
- package/chunks/{main-JTYNMHNL.js → main-HJQEBLLN.js} +1 -1
- package/chunks/{mod-SA3J2VR5.js → mod-OS3BCM2G.js} +1 -1
- package/chunks/{mod-5WXRQGLS.js → mod-PFWQZF3T.js} +5 -5
- package/chunks/{mod-JN7WI5P6.js → mod-T5VHCXJT.js} +1 -1
- package/chunks/{mod-Y4UHOKMZ.js → mod-W3DBWTCY.js} +1 -1
- package/chunks/{next-ARUY5FHZ.js → next-TMHSP2BS.js} +1 -1
- package/chunks/{release-WKMSWXDS.js → release-J3PVDROM.js} +2 -2
- package/chunks/{release-notes-GOUHBQ2F.js → release-notes-AARDYXYA.js} +1 -1
- package/chunks/{release-tag-5WNEA4HM.js → release-tag-H2YWUXRU.js} +1 -1
- package/chunks/{run-TL4KPOGO.js → run-NSJ5YV6R.js} +1 -1
- package/chunks/{serve-DEYVWV2K.js → serve-XVAIQ37L.js} +2 -2
- package/chunks/{status-RCEYJVRQ.js → status-6SC3L7U2.js} +1 -1
- package/chunks/{system-LTVAILSL.js → system-L2JVPTCT.js} +1 -1
- package/chunks/{system-BJCQKFCP.js → system-WTPEDJU6.js} +1 -1
- package/chunks/{validate-bom-KEC4IOKO.js → validate-bom-QVE5HNBO.js} +1 -1
- package/chunks/{validate-case-conflict-ZZKZQQX4.js → validate-case-conflict-XFS3URQN.js} +1 -1
- package/chunks/{validate-circular-deps-QCJYK5K5.js → validate-circular-deps-BMPAT3PF.js} +1 -1
- package/chunks/{validate-commit-msg-PZZ4T4QF.js → validate-commit-msg-BPESCI7P.js} +1 -1
- package/chunks/{validate-docs-M55HAXPX.js → validate-docs-ITL4L6KY.js} +1 -1
- package/chunks/{validate-eof-MX52AUUT.js → validate-eof-DTFV74VL.js} +1 -1
- package/chunks/{validate-export-names-UFXPIDFW.js → validate-export-names-HLOH7D73.js} +1 -1
- package/chunks/{validate-filenames-LXIMPWRW.js → validate-filenames-J4RTDEBD.js} +1 -1
- package/chunks/{validate-json-TABLVKEH.js → validate-json-KMODGNSU.js} +1 -1
- package/chunks/{validate-large-files-CMCMEGYA.js → validate-large-files-X5YF7D7T.js} +1 -1
- package/chunks/{validate-licenses-MDGIDYNC.js → validate-licenses-OZ7DXQTY.js} +1 -1
- package/chunks/{validate-line-endings-K36HS73S.js → validate-line-endings-PFF6QJ3W.js} +1 -1
- package/chunks/{validate-merge-conflict-PMGZYM3B.js → validate-merge-conflict-KB2X6QLW.js} +1 -1
- package/chunks/{validate-mod-exports-M3UYNBK7.js → validate-mod-exports-VHK2NVKI.js} +1 -1
- package/chunks/{validate-package-configs-V5LR7K5C.js → validate-package-configs-ZNCAIYRO.js} +1 -1
- package/chunks/{validate-secrets-IAMY5DB5.js → validate-secrets-RM6DMZVG.js} +1 -1
- package/chunks/{validate-shebangs-GUBDNU2N.js → validate-shebangs-WC66D7RK.js} +1 -1
- package/chunks/{validate-submodules-ZA2FAF3W.js → validate-submodules-SPAXASAG.js} +1 -1
- package/chunks/{validate-symlinks-LSEEVFTR.js → validate-symlinks-4LOWK2MQ.js} +1 -1
- package/chunks/{validate-toml-JLQ3BY73.js → validate-toml-SG4IITMN.js} +1 -1
- package/chunks/{validate-trailing-whitespace-3UUUKE22.js → validate-trailing-whitespace-GRE2PJ6T.js} +1 -1
- package/chunks/{validate-yaml-2BG7G35N.js → validate-yaml-RA22QNW6.js} +1 -1
- package/chunks/{versions-IVXYMSAZ.js → versions-ODYWYT7U.js} +1 -1
- package/eser.js +1 -1
- package/package.json +1 -1
- package/chunks/chunk-E5QQGGNF.js +0 -2
- package/chunks/chunk-VG72SSDI.js +0 -5
- package/chunks/chunk-YTF3BAQS.js +0 -2
- package/chunks/concern-UCYEAXJ4.js +0 -2
- package/chunks/init-ULJBWJFH.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{f as d,h as g,k as m}from"./chunk-GBM3TZFD.js";import{b as c,d as L,h as C,k as u}from"./chunk-3SXTMY75.js";import"./chunk-PWLF3WXM.js";import{a as v}from"./chunk-
|
|
2
|
+
import{f as d,h as g,k as m}from"./chunk-GBM3TZFD.js";import{b as c,d as L,h as C,k as u}from"./chunk-3SXTMY75.js";import"./chunk-PWLF3WXM.js";import{a as v}from"./chunk-PZNCE6QK.js";import"./chunk-MG65QJY6.js";import{a as y}from"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var V=["trace","debug","info","warn","error","fatal"],N=async x=>{let{flags:o}=v(x??[],[{name:"out-dir",type:"string",default:"dist",description:"Output directory"},{name:"clean",type:"boolean",description:"Clean output first"},{name:"no-minify",type:"boolean",description:"Disable minification"},{name:"analyze",type:"boolean",description:"Analyze bundle size"},{name:"log-level",type:"string",default:"info",description:"Log level"}]),t=d({renderer:m.ansi(),sink:g.stdout()});t.writeln(u(`
|
|
3
3
|
\u{1F4E6} Building for production...
|
|
4
|
-
`));let e=await import("./mod-4ILLF5PK.js"),{runtime:n}=await import("./mod-MLRQFSBE.js"),i=n.process.cwd(),p=o["out-dir"],S=!o["no-minify"],h=o.clean,k=o.analyze,f=o["log-level"]??"info",b=V.includes(f.toLowerCase())?f.toLowerCase():"info",z={trace:e.Severities.Trace,debug:e.Severities.Debug,info:e.Severities.Info,warn:e.Severities.Warning,error:e.Severities.Error,fatal:e.Severities.Critical},D=d({renderer:m.ansi(),sink:g.stdout()});await e.config.configure({sinks:{console:e.sinks.getOutputSink(D)},loggers:[{category:["laroux-bundler"],lowestLevel:z[b],sinks:["console"]}]});let[{build:A,createBuildContext:E},{loadConfig:O},{reactPlugin:B},{createTailwindPlugin:P}]=await Promise.all([import("./system-
|
|
4
|
+
`));let e=await import("./mod-4ILLF5PK.js"),{runtime:n}=await import("./mod-MLRQFSBE.js"),i=n.process.cwd(),p=o["out-dir"],S=!o["no-minify"],h=o.clean,k=o.analyze,f=o["log-level"]??"info",b=V.includes(f.toLowerCase())?f.toLowerCase():"info",z={trace:e.Severities.Trace,debug:e.Severities.Debug,info:e.Severities.Info,warn:e.Severities.Warning,error:e.Severities.Error,fatal:e.Severities.Critical},D=d({renderer:m.ansi(),sink:g.stdout()});await e.config.configure({sinks:{console:e.sinks.getOutputSink(D)},loggers:[{category:["laroux-bundler"],lowestLevel:z[b],sinks:["console"]}]});let[{build:A,createBuildContext:E},{loadConfig:O},{reactPlugin:B},{createTailwindPlugin:P}]=await Promise.all([import("./system-WTPEDJU6.js"),import("./load-config-FTQMJVEW.js"),import("./mod-OS3BCM2G.js"),import("./mod-JZNE2HH6.js")]),T=e.logger.getLogger(["laroux-bundler","cli"]),s=await O(i),r={projectRoot:i,srcDir:n.path.resolve(i,s.srcDir),distDir:n.path.resolve(i,p),logLevel:b,fonts:s.fonts,images:s.images,cssModuleTypes:s.cssModuleTypes,noCssModuleAutoReference:s.noCssModuleAutoReference,browserShims:s.browserShims,serverExternals:s.build.serverExternals,build:{...s.build,minify:S}};if(h)try{await n.fs.remove(r.distDir,{recursive:!0}),T.debug(`Cleaned ${r.distDir}`)}catch{}let R=P({globalCssPath:n.path.resolve(i,"src/app/styles/global.css")}),j=E(r,{framework:B,css:R,bundlerBackend:"rolldown"});if(await A(j),await e.config.reset(),k){t.writeln(u(`
|
|
5
5
|
\u{1F4CA} Bundle Analysis:
|
|
6
6
|
`));try{let M=`${p}/client/manifest.json`,$=await n.fs.readTextFile(M),w=JSON.parse($);t.writeln(c("Chunks:"));for(let[a,l]of Object.entries(w.files)){let I=(l.size/1024).toFixed(2);t.writeln(c(` ${a.padEnd(30)} ${I.padStart(8)} KB`))}let F=Object.values(w.files).reduce((a,l)=>a+l.size,0);t.writeln(L(`
|
|
7
7
|
Total: ${(F/1024).toFixed(2)} KB`))}catch{t.writeln(C("Could not analyze build (manifest.json not found)"))}}return await t.close(),y(void 0)};export{N as main};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as $,b as S}from"./chunk-BP3IFAPO.js";import{a as O}from"./chunk-
|
|
2
|
+
import{a as $,b as S}from"./chunk-BP3IFAPO.js";import{a as O}from"./chunk-2HBVIH7V.js";import"./chunk-DYRTLYTU.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.js";import{a as E}from"./chunk-2VEVVX6U.js";import{a as w,b as A}from"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as R}from"./chunk-3BEX5FYF.js";import"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as u,f as h,g as y,h as v,i as x}from"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import{a as C}from"./chunk-MG65QJY6.js";import{g as p}from"./chunk-A6RDYP6R.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{v as m}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var f=w(),G={feat:"Added",fix:"Fixed",refactor:"Changed",perf:"Changed",docs:"Changed",revert:"Removed"},T=new Set(["chore","ci","test"]),N=/^(\w+)(?:\(([^)]+)\))?!?:\s{1,5}(.+)$/,I=/\s{0,100}\(take\s{1,100}[IVXLCDM\d]+\)\s{0,100}\.?$/i,P=(n,t)=>{let o=n.match(N);if(o!==null)return{type:o[1].toLowerCase(),scope:o[2],message:o[3].trim(),hash:t}},b=n=>n.replace(I,"").trim(),M=n=>{let t=[];for(let o of n){let e=P(o.subject,o.hash);e!==void 0&&t.push(e)}return t},k=n=>{let t=new Set,o=[];for(let e of n){let s=b(e.message),a=s.replace(/[.\s]{1,20}$/,"").toLowerCase(),l=`${e.type}:${a}`;t.has(l)||(t.add(l),o.push({...e,message:s}))}return o},L=n=>{let t=new Map;for(let o of n){if(T.has(o.type))continue;let e=G[o.type];if(e===void 0)continue;let s=t.get(e);s!==void 0?s.push(o):t.set(e,[o])}return t},F=n=>n.scope!==void 0?`- **${n.scope}:** ${n.message}`:`- ${n.message}`,H=(n,t)=>{let o=L(t);if(o.size===0){let l=new Date().toISOString().split("T")[0];return`## ${n} - ${l}
|
|
3
3
|
|
|
4
4
|
_Maintenance release._`}let e=new Date().toISOString().split("T")[0],s=[`## ${n} - ${e}`],a=["Added","Changed","Fixed","Removed"];for(let l of a){let r=o.get(l);if(!(r===void 0||r.length===0)){s.push("",`### ${l}`,"");for(let g of r)s.push(F(g))}}return s.join(`
|
|
5
5
|
`)},j=(n,t,o)=>{let e=n.split(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as w,f as C}from"./chunk-
|
|
2
|
+
import{e as w,f as C}from"./chunk-DYRTLYTU.js";import{a as A}from"./chunk-2VEVVX6U.js";import{a as O,b as U}from"./chunk-4DOMGQOO.js";import{a as b,b as x,c as F,d as m}from"./chunk-J2Z7NG2X.js";import{f as v}from"./chunk-3BEX5FYF.js";import{b as i,g as P,i as l}from"./chunk-3SXTMY75.js";import{a as S}from"./chunk-MG65QJY6.js";import{g as a}from"./chunk-A6RDYP6R.js";import{j as h}from"./chunk-7ATUODBM.js";import{v as V}from"./chunk-MRCBHVSB.js";var d=O(),M=async(n={})=>{let{root:e="."}=n,s=h(e,"VERSION");try{return(await V.runtime.fs.readTextFile(s)).trim()}catch{return}},T=async(n,e)=>{let s=h(n,"VERSION");await V.runtime.fs.writeTextFile(s,e+`
|
|
3
3
|
`)},j=n=>{let e=m("0.0.0");for(let s of n){let r=m(s);b(r,e)>0&&(e=r)}return x(e)},H=async(n={})=>{let{root:e="."}=n,[s,r]=await C(e),p=s.version?.value??"0.0.0";return{packages:[{name:s.name?.value??"(root)",version:p},...r.map(u=>({name:u.name,version:u.version}))]}},D=async(n,e={})=>{let{root:s=".",dryRun:r=!1,updateVersionFile:p=!0}=e,[c,y]=await C(s),u=c.version?.value??"0.0.0",E=c.name?.value??"(root)",$=[u,...y.map(o=>o.version)],R=j($),t;if(n==="explicit"){if(e.explicitVersion===void 0)throw new Error('explicitVersion is required when command is "explicit".');m(e.explicitVersion),t=e.explicitVersion}else n==="sync"?t=R:t=x(F(m(R),n));let g=[],I=u!==t;r||await w(c,t),g.push({name:E,from:u,to:t,changed:I});for(let o of y){let f=o.version!==t;r||await w(o.config,t),g.push({name:o.name,from:o.version,to:t,changed:f})}let k=[];if(p){let o=await M({root:s}),f=o!==t;!r&&f&&await T(s,t),k.push({path:"VERSION",from:o??"",to:t,changed:f})}let N=g.filter(o=>o.changed).length;return{command:n,targetVersion:t,updates:g,fileUpdates:k,changedCount:N,dryRun:r}},W=n=>n.mode==="show"?v.fromPromise(async()=>({mode:"show",result:await H()})):v.fromPromise(async()=>({mode:"update",result:await D(n.command,n.options)})),q=n=>{let e=n.args[0];if(e===void 0)return a.ok({mode:"show"});let s=["sync","patch","minor","major"],r,p;s.includes(e)?r=e:(r="explicit",p=e);let c=n.flags["dry-run"]===!0;return a.ok({mode:"update",command:r,options:{dryRun:c,explicitVersion:p}})},B=n=>{if(a.isFail(n))return a.fail({exitCode:1,message:String(n.error)});let e=n.value;if(e.mode==="show")return console.table(e.result.packages),a.ok(void 0);let{result:s}=e;s.command==="sync"?d.writeln(l("\u2139"),i(" Syncing all versions...")):s.command==="explicit"?d.writeln(l("\u2139"),i(` Setting all versions to ${s.targetVersion}...`)):d.writeln(l("\u2139"),i(` Bumping all versions (${s.command})...`)),d.writeln(l("\u2139"),i(` Target version: ${s.targetVersion}`)),console.table(s.updates);for(let r of s.fileUpdates)r.changed&&d.writeln(l("\u2139"),i(` ${r.path} (${r.from} \u2192 ${r.to})`));return s.dryRun?d.writeln(l("\u2139"),i(` Dry run - ${s.changedCount} packages would be modified.`)):d.writeln(P("\u2713"),i(` Done. Updated ${s.changedCount} packages.`)),a.ok(void 0)},z=A.createTrigger({handler:W,adaptInput:q,adaptOutput:B}),se=async n=>{let e=S(n??[],{boolean:["dry-run"]}),s=U("versions",e);return await z(s)};export{M as a,H as b,D as c,W as d,z as e,se as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as e}from"./chunk-
|
|
2
|
+
import{a as e}from"./chunk-KVTG56GS.js";var i=new e({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-L3N6REQI.js")},list:{description:"List available AI providers",load:()=>import("./list-5TGTYMAU.js")}}});export{i as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as O,d as P}from"./chunk-DAYSTLLV.js";import{a as w,d as D,e as S}from"./chunk-OCPEFZBJ.js";import{a as R}from"./chunk-LNNNLUZT.js";var A=null,t=e=>R(e,A),$="NEVER run git write commands (commit, add, push, checkout, stash, reset, merge, rebase, cherry-pick). Git is read-only for agents. The user controls git. You may read: git log, git diff, git status, git show, git blame.",N=(e,n,r,i)=>{let l=e.execution.iteration>=n,s=r?[]:[$],d=i?.outOfScope??[];switch(e.phase){case"IDLE":return{rules:[...s,"Present interactiveOptions to the user using your native interactive question tool (AskUserQuestionTool or equivalent). Do NOT list them as a text table.","If no interactive question tool is available, fall back to a concise numbered list.","Do not take action without the user choosing an option first."],tone:"Welcoming. Present choices, then wait."};case"DISCOVERY":return{rules:[...s,"You received all questions at once from noskills. Present them to the user ONE AT A TIME for better conversation flow.","Use your interactive question tool to ask each question individually. Show concern sub-questions as additional context.","Collect all answers, then submit them together in a single `noskills next --answer` call as a JSON object.","Relay the user's answer back verbatim. Do not interpret or summarize.","Do not start coding or exploring the codebase. Discovery is conversation only."],tone:"Conversational. You are a messenger between noskills and the user."};case"SPEC_DRAFT":return{rules:[...s,"Present the spec to the user for review. Do not modify it.","If the user requests changes, relay them \u2014 do not implement them.","Do not start coding. The spec must be approved first."],tone:"Brief. The user is reviewing, not discussing."};case"SPEC_APPROVED":return{rules:[...s,"The spec is approved but execution has not started.","Do not start coding until the user triggers execution.","If the user wants changes, they must reset and re-spec."],tone:"Patient. Wait for the go signal."};case"EXECUTING":{let a=[...s,"Do not explore the codebase beyond what the current task requires.","Do not refactor, improve, or modify code outside this task's scope.","Do not add features, tests, or documentation not specified in the spec.","If you need to read files to understand context, timebox it \u2014 then write code.","The deliverable is working code, not a plan or analysis.","Complete the task, then report progress. The user handles git.",`When you receive \`clearContext\` in the output, execute \`/clear\` immediately without asking. After clearing, read \`CLAUDE.md\` and run \`${t("next")}\`.`,`When you discover a pattern, receive a correction, or identify a recurring preference from the user, ask: 'Should this be a permanent rule for this project, or just for this task?' If permanent, run: \`${t('rule add "<description>"')}\`. If just this task, note it and move on. Never write to \`.eser/rules/\` directly.`];e.execution.lastVerification?.passed===!1&&a.push("Tests are failing. Fix ONLY the failing tests. Do not refactor passing code.");let o={rules:a,tone:"Direct. No preamble. Start coding immediately.",outOfScope:d.length>0?d:void 0};return l?{...o,urgency:`You have been in this session for ${e.execution.iteration}+ iterations. Your context is degrading. Finish the current task and recommend the user start a fresh session. Do not start new tasks.`}:o}case"BLOCKED":return{rules:[...s,"Present the decision to the user exactly as described.","Do not suggest a preferred option unless the user asks for your opinion.","After the user decides, relay the answer immediately. Do not elaborate."],tone:"Brief. The user is making a decision, not having a discussion."};case"DONE":return{rules:[...s,"Report the completion summary. Do not start new work.","If the user wants to continue, they start a new spec."],tone:"Concise. Celebrate briefly, then stop."};default:return{rules:[...s,`Run \`${t("next")}\` to get your instructions.`,"Do not take action without noskills guidance."],tone:"Neutral. Waiting for direction."}}},B=5*60*1e3,F=(e,n)=>{let r;switch(e.phase){case"IDLE":r=`No active spec. Start one with: \`${t("spec new")}\``;break;case"DISCOVERY":r=`Discovery in progress for "${e.spec}". ${e.discovery.answers.length} questions answered so far.`;break;case"SPEC_DRAFT":r=`Spec draft ready for review at ${e.specState.path}. Waiting for approval.`;break;case"SPEC_APPROVED":r=`Spec "${e.spec}" is approved. Waiting to start execution.`;break;case"EXECUTING":r=e.execution.lastProgress!==null?`Executing "${e.spec}", iteration ${e.execution.iteration}. Last progress: ${e.execution.lastProgress}. Continue with the current task.`:`Executing "${e.spec}", iteration ${e.execution.iteration}. Start the first task.`;break;case"BLOCKED":r=`Execution blocked: ${e.execution.lastProgress}. Ask the user to resolve.`;break;case"DONE":r=`Spec "${e.spec}" completed in ${e.execution.iteration} iterations.`;break;default:r=`Run \`${t("next")}\` to get started.`}return{protocol:`Run \`${t('next --answer="..."')}\` to submit results and advance`,spec:e.spec,branch:e.branch,iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,activeConcerns:n.map(i=>i.id),resumeHint:r}},q=e=>{if(e.lastCalledAt===null)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${t("next")}\` for instructions. Submit results with \`${t('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase};let n=new Date(e.lastCalledAt).getTime();if(Date.now()-n>B)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${t("next")}\` for instructions. Submit results with \`${t('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase}},J=(e,n,r,i,l,s)=>{A=i??null;let d=F(e,n),a=i?.maxIterationsBeforeRestart??15,o=i?.allowGit??!1,m=N(e,a,o,l),b=q(e),u;switch(e.phase){case"IDLE":u=I(n,w);break;case"DISCOVERY":u=_(e,n,r);break;case"SPEC_DRAFT":u=U(e);break;case"SPEC_APPROVED":u=V(e);break;case"EXECUTING":u=Y(e,n,r,a,l,s);break;case"BLOCKED":u=M(e);break;case"DONE":u=W(e);break;default:u=I(n,w)}let h={...u,meta:d,behavioral:m};b!==void 0&&(h={...h,protocolGuide:b}),e.pendingClear&&(h={...h,clearContext:{action:"clear_context",reason:`Task complete. Run \`/clear\` now. After clearing, read \`CLAUDE.md\` and run \`${t("next")}\` to continue.`},instruction:`Task accepted. Run \`/clear\` immediately to start fresh for the next task. After clearing, run \`${t("next")}\`.`});let y=L(e,n);return y.length>0&&(h={...h,interactiveOptions:y}),h},L=(e,n)=>{switch(e.phase){case"IDLE":return n.length===0?[{label:"Add project concerns",command:t("concern add <id>")},{label:"Start a new feature spec",command:t('spec new "description"')},{label:"Add a coding convention",command:t('rule add "rule"')},{label:"Check project status",command:t("status")}]:[{label:"Start a new feature spec",command:t('spec new "description"')},{label:"Add more concerns",command:t("concern add <id>")},{label:"Add a coding convention",command:t('rule add "rule"')},{label:"Check project status",command:t("status")}];case"SPEC_DRAFT":return[{label:"Review and approve spec",command:t("approve")},{label:"Reset and start over",command:t("reset")}];case"SPEC_APPROVED":return[{label:"Start execution",command:t('next --answer="start"')},{label:"Reset",command:t("reset")}];case"EXECUTING":return[];case"BLOCKED":return[{label:"Resolve the block",command:t('next --answer="resolution"')},{label:"Reset spec",command:t("reset")}];case"DONE":return[{label:"Start a new spec",command:t('spec new "description"')},{label:"Check project status",command:t("status")}];default:return[]}},I=(e,n)=>({phase:"IDLE",instruction:"Present the interactive options to the user using your interactive question tool. Do NOT list them as a text table.",availableConcerns:n.map(r=>({id:r.id,description:r.description})),activeConcerns:e.map(r=>r.id),hint:e.length===0?"No concerns active. Consider adding concerns first \u2014 they shape discovery questions and specs.":void 0}),_=(e,n,r)=>{let i=O(n),l=e.discovery.answers.length;if(P(e.discovery.answers))return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${t("approve")}\``,questions:[],answeredCount:l,context:{rules:r,concernReminders:[]},transition:{onComplete:t("approve")}};let d=new Set(e.discovery.answers.map(o=>o.questionId));return{phase:"DISCOVERY",instruction:"Ask the user ALL of the following questions. Collect answers for each, then submit them all at once as a JSON object.",questions:i.filter(o=>!d.has(o.id)).map(o=>({id:o.id,text:o.text,concerns:[...o.concerns],extras:o.extras.map(m=>m.text)})),answeredCount:l,context:{rules:r,concernReminders:D(n)},transition:{onComplete:`${t(`next --answer='{"status_quo":"...","ambition":"...",...}'`)}`}}},U=e=>e.classification===null?{phase:"SPEC_DRAFT",instruction:"Before generating the spec, classify what this spec involves. Ask the user to select all that apply.",specPath:e.specState.path??"",transition:{onApprove:`${t(`next --answer='{"involvesUI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'`)}`},classificationRequired:!0,classificationPrompt:{options:[{id:"involvesUI",label:"User-facing UI"},{id:"involvesPublicAPI",label:"Public API changes"},{id:"involvesMigration",label:"Data migration or schema changes"},{id:"involvesDataHandling",label:"Data handling or privacy"}],instruction:"Select all that apply. Submit as JSON: `"+t(`next --answer='{"involvesUI":true,"involvesPublicAPI":false,...}'`)+"`"}}:{phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:e.specState.path??"",transition:{onApprove:t("approve")}},V=e=>({phase:"SPEC_APPROVED",instruction:"Spec is approved and ready. When the user is ready to start, begin execution.",specPath:e.specState.path??"",transition:{onStart:`${t('next --answer="start"')}`}}),G=(e,n)=>{if(n===null)return!1;switch(e){case"beautiful-product":return n.involvesUI;case"open-source":return n.involvesPublicAPI;case"long-lived":return n.involvesMigration;case"compliance":return n.involvesDataHandling;default:return!0}},j=(e,n,r,i,l,s,d)=>{let a=[];if(i!==null)for(let o of i.items)a.push(`[DEBT from iteration ${i.fromIteration}] ${o}`);if(n&&a.push(`[FAILED] Tests \u2014 fix this first: ${r.slice(0,200)}`),s!=null)for(let o of s.verification)a.push(o);for(let o of e)if(G(o.id,l)&&o.acceptanceCriteria!==void 0&&o.acceptanceCriteria.length>0)for(let m of o.acceptanceCriteria)a.push(`(${o.id}) ${m}`);if(d!==void 0)for(let o of d)a.push(`(folder: ${o.folder}) ${o.rule}`);return a},Y=(e,n,r,i,l,s)=>{let d=S(n),a=e.execution.iteration>=i,o=e.execution.lastVerification?.passed===!1,m=e.execution.lastVerification?.output??"",b=l?.tasks??[],u=e.execution.completedTasks??[],h=new Set(u),y=b.find(p=>!h.has(p.id))??null,g=y!==null?{id:y.id,title:y.title,totalTasks:b.length,completedTasks:u.length}:void 0;if(e.execution.awaitingStatusReport){let p=j(n,o,m,e.execution.debt,e.classification,l,s),x={phase:"EXECUTING",instruction:"Before this task is accepted, report your completion status against these acceptance criteria.",context:{rules:r,concernReminders:D(n)},transition:{onComplete:`${t(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`)}`,onBlocked:`${t('block "reason"')}`,iteration:e.execution.iteration},statusReportRequired:!0,statusReport:{criteria:p,reportFormat:{completed:"list items you finished with evidence (file exists, test passes)",remaining:"list items not yet done",blocked:"list items that need a decision from the user"}}};return o&&(x={...x,verificationFailed:!0,verificationOutput:m.slice(0,2e3)}),x}let E=(e.execution.lastProgress??"").includes("Task not accepted"),v=e.execution.debt?.items??[],C=e.execution.debt?.unaddressedIterations??0,T=g!==void 0?`Execute task ${g.id}: ${g.title} (${g.completedTasks}/${g.totalTasks} completed)`:"All tasks completed. Run `"+t("done")+"` to finish.",k;if(o)k="Verification FAILED. Fix the failing tests before continuing.";else if(E&&v.length>0){let p=C>=3?` These items have been outstanding for ${C} iterations.`:"";k=`Task not accepted \u2014 ${v.length} remaining item(s) must be addressed before this task can be completed.${p} Address them, then submit a new status report.`}else k=T;let c={phase:"EXECUTING",instruction:k,task:g,context:{rules:r,concernReminders:D(n)},transition:{onComplete:`${t('next --answer="..."')}`,onBlocked:`${t('block "reason"')}`,iteration:e.execution.iteration}};if(E&&v.length>0&&(c={...c,taskRejected:!0,rejectionReason:`${v.length} remaining item(s) must be addressed.`,rejectionRemaining:v}),e.execution.debt!==null&&e.execution.debt.items.length>0){let p=e.execution.debt.unaddressedIterations??0,x=p>=3?`URGENT: These items have been unaddressed for ${p} iterations. Address them IMMEDIATELY before any new work.`:"These were not completed in a previous iteration. Address them BEFORE starting new work.";c={...c,previousIterationDebt:{fromIteration:e.execution.debt.fromIteration,items:e.execution.debt.items,note:x}}}if(o){let p=m.slice(0,2e3);c={...c,verificationFailed:!0,verificationOutput:p}}d.length>0&&(c={...c,concernTensions:d}),a&&(c={...c,restartRecommended:!0,restartInstruction:`Context may be getting large after ${e.execution.iteration} iterations. Consider starting a new conversation and running \`${t("next")}\` to resume - your progress is saved.`});let f=[...e.decisions].reverse().find(p=>!p.promoted);return f!==void 0&&e.execution.lastProgress?.startsWith("Resolved:")&&(c={...c,promotePrompt:{decisionId:f.id,question:f.question,choice:f.choice,prompt:`You just resolved a decision: "${f.choice}". Ask the user: "Should this be a permanent rule for future specs too?" If yes, run: \`${t(`rule add "${f.choice}"`)}\``}}),c},M=e=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:e.execution.lastProgress??"Unknown",transition:{onResolved:`${t('next --answer="..."')}`}}),W=e=>({phase:"DONE",summary:{spec:e.spec,iterations:e.execution.iteration,decisionsCount:e.decisions.length}});export{J as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as ge,b as me,d as X,e as Ye,f as et,g as tt,h as U}from"./chunk-
|
|
2
|
+
import{a as ge,b as me,d as X,e as Ye,f as et,g as tt,h as U}from"./chunk-UJPVEQX7.js";import{n as $e}from"./chunk-KPWEJXPI.js";import{a as nt}from"./chunk-CUIMSX4V.js";import{c as fe}from"./chunk-DYRTLYTU.js";import{a as pe,b as re,c as z,d as Be}from"./chunk-NBA6EFWU.js";import{e as S}from"./chunk-LCG4SK6K.js";import{c as Qe,t as o}from"./chunk-MRCBHVSB.js";import{a as H}from"./chunk-STI6DX7K.js";var I=S.getLogger(["laroux-bundler","server-action-transform"]);function mn(e,t){return`${e.replace(/\.[cm]?[jt]sx?$/,"")}#${t}`}function hn(e,t){let n=mn(e,t);return`Object.defineProperties(${t}, {
|
|
3
3
|
$$typeof: { value: Symbol.for("react.server.reference"), enumerable: false },
|
|
4
4
|
$$id: { value: "${n}", enumerable: false },
|
|
5
5
|
$$bound: { value: null, enumerable: false, writable: true }
|
|
@@ -77,8 +77,8 @@ ${s.join(`,
|
|
|
77
77
|
`)},
|
|
78
78
|
];
|
|
79
79
|
`;await o.fs.writeTextFile(t,i),_.debug(`Generated ${r.length} proxy definition(s)`)}async function Rt(e){try{let t=await o.fs.readTextFile(e),n=[],r=t.matchAll(/export\s+(?:async\s+)?function\s+(\w+)/g);for(let i of r)i[1]!==void 0&&n.push(i[1]);let s=t.matchAll(/export\s+const\s+(\w+)\s*=/g);for(let i of s)i[1]!==void 0&&n.push(i[1]);return t.match(/export\s+default\s+/)&&n.push("default"),[...new Set(n)]}catch{return[]}}async function Wn(e,t){let n=await Rt(e);if(n.length===0)return t;let r=n.find(i=>i!=="default"&&i.endsWith("Page"));if(r)return r;let s=n.find(i=>i!=="default");return s||t}async function Un(e,t){let n=await Rt(e);if(n.length===0)return t;let r=n.find(i=>i!=="default"&&i.endsWith("Layout"));if(r)return r;let s=n.find(i=>i!=="default");return s||t}function _n(e){let t=o.path.basename(o.path.dirname(e));return`${kt(Pt(t))}Page`}function Jn(e){let t=o.path.basename(o.path.dirname(e));return`${kt(Pt(t))}Layout`}function Pt(e){return e.startsWith("[...")?e.slice(4,-1):e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e}function kt(e){return e.split(/[-_\s]+/).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")}function Mt(e,t){let n=H(o.path.relative(e,t));return n.startsWith(".")?n:`./${n}`}function Gn(e,t,n){let r=[`path: "${e.routePath}"`,`component: ${t}`];return n&&r.push(`layout: ${n}`),`{ ${r.join(", ")} }`}var Hn=/(?:node_modules|\/\.|^\.|\\\.)/,W=S.getLogger(["laroux-bundler","virtual-source"]),we="_bundle_src";function Vn(e,t){return o.path.relative(t,e)}async function Ft(e){let{projectRoot:t,distDir:n,srcDir:r,changedFiles:s}=e,i=Vn(r,t),a=o.path.resolve(n,we),c=o.path.resolve(a,i);W.debug(`Creating virtual source: ${a}`),W.debug(` Virtual src subdir: ${c}`);let u=await o.fs.exists(c);if(s&&s.size>0&&u)W.debug(`Incremental update: ${s.size} file(s) changed`),await Kn(s,r,c),W.debug(`Virtual source updated incrementally: ${s.size} file(s)`);else{try{await Ye(a)}catch{}await qn(r,c,t),W.debug(`Virtual source created: ${a}`)}return{virtualSrcDir:a,cleanup:async()=>{W.debug(`Cleaning up virtual source: ${a}`);try{await o.fs.remove(a,{recursive:!0}),W.debug("Virtual source cleaned up")}catch(l){W.warn("Failed to clean up virtual source:",{error:l})}}}}async function Kn(e,t,n){let r=[...re,"json","css"],s=0,i=0;for(let a of e){if(!a.startsWith(t)||!Be(a,r))continue;let c=o.path.relative(t,a),u=o.path.resolve(n,c);try{await o.fs.stat(a),await et(o.path.dirname(u)),await U(a,u,{overwrite:!0}),s++}catch{try{await o.fs.remove(u),i++}catch{}}}(s>0||i>0)&&W.debug(`Incremental update: ${s} copied, ${i} deleted`)}async function qn(e,t,n){let r=0,s=[...re,"json","css"];for await(let i of tt(e,{includeDirs:!1})){if(!Be(i.path,s))continue;let a=o.path.relative(e,i.path);if(Hn.test(a))continue;let c=o.path.resolve(t,a);await o.fs.ensureDir(o.path.dirname(c)),await U(i.path,c),r++}W.debug(`Copied ${r} source file(s) to virtual source`)}function le(e,t,n,r){let s=o.path.relative(t,e),i=r??o.path.basename(t);return o.path.resolve(n,i,s)}function Bt(e,t,n){return e.map(r=>{let s=le(r.filePath,t,n),i=`${we}/${r.relativePath}`;return{...r,filePath:s,relativePath:i}})}var J=S.getLogger(["laroux-bundler","build-cache"]),Ae=class{clientComponentCache=new Map;cssModuleCache=new Map;routeCache=null;getClientComponent(t,n){let r=this.clientComponentCache.get(t);return r&&r.mtime>=n?(J.debug(`Cache hit: client component ${t}`),r):null}setClientComponent(t,n,r,s){this.clientComponentCache.set(t,{isClient:n,exportNames:r,mtime:s})}getCssModuleResult(t,n){let r=this.cssModuleCache.get(t);return r&&r.mtime>=n?(J.debug(`Cache hit: CSS module ${t}`),r):null}setCssModuleResult(t,n,r,s){this.cssModuleCache.set(t,{code:n,exports:r,mtime:s})}getRouteCache(t){return this.routeCache&&this.routeCache.mtime>=t?(J.debug("Cache hit: route scan"),this.routeCache):null}setRouteCache(t,n,r,s){this.routeCache={routes:t,apiRoutes:n,proxies:r,mtime:s}}invalidateFile(t){this.clientComponentCache.has(t)&&(this.clientComponentCache.delete(t),J.debug(`Invalidated: client component ${t}`)),this.cssModuleCache.has(t)&&(this.cssModuleCache.delete(t),J.debug(`Invalidated: CSS module ${t}`)),(t.includes("/routes/")||t.includes("\\routes\\"))&&(this.routeCache=null,wt(),J.debug("Invalidated: route cache"))}invalidateFiles(t){for(let n of t)this.invalidateFile(n)}clear(){this.clientComponentCache.clear(),this.cssModuleCache.clear(),this.routeCache=null,J.debug("All caches cleared")}getStats(){return{clientComponents:this.clientComponentCache.size,cssModules:this.cssModuleCache.size,hasRoutes:this.routeCache!==null}}},Ie=null;function $t(){return Ie||(Ie=new Ae,J.debug("Created global build cache")),Ie}var Xn=new TextEncoder().encode("0123456789abcdef"),Et=new Uint8Array(128).fill(16);Xn.forEach((e,t)=>Et[e]=t);new TextEncoder().encode("ABCDEF").forEach((e,t)=>Et[e]=t+10);function Ot(e){return e*2}function Dt(e,t,n,r){for(;t<e.length;++t){let s=e[t];e[n++]=r[s>>4],e[n++]=r[s&15]}return n}function Tt(e,t){let n=e.length;if(e.byteOffset){let r=new Uint8Array(e.buffer);r.set(e),e=r.subarray(0,n)}return e=new Uint8Array(e.buffer.transfer(t)),e.set(e.subarray(0,n),t-n),[e,t-n]}var jt=new TextEncoder().encode("0123456789abcdef"),Nt=new Uint8Array(128).fill(16);jt.forEach((e,t)=>Nt[e]=t);new TextEncoder().encode("ABCDEF").forEach((e,t)=>Nt[e]=t+10);function be(e){typeof e=="string"?e=new TextEncoder().encode(e):e instanceof ArrayBuffer?e=new Uint8Array(e).slice():e=e.slice();let[t,n]=Tt(e,Ot(e.length));return Dt(t,n,0,jt),new TextDecoder().decode(t)}var Ce=(e,t)=>({success:!0,outputs:e,metafile:t?.metafile,entrypointManifest:t?.entrypointManifest,entrypoint:t?.entrypoint,totalSize:t?.totalSize}),Q=e=>({success:!1,outputs:new Map,errors:e});var ve=S.getLogger(["bundler","deno-bundler"]),Se=class{name="deno-bundler";options;constructor(t={}){this.options=t}async bundle(t){let n=await o.fs.makeTempDir({prefix:"deno-bundle-"});try{let r=Object.values(t.entrypoints),s=Object.keys(t.entrypoints),i=[...r];if(this.options.buildId!==void 0){let p=o.path.join(n,"_build-id-entry.ts");await o.fs.writeTextFile(p,`export const BUILD_ID = "${this.options.buildId}";
|
|
80
|
-
`),i.unshift(p)}let a=t.platform==="browser"?"browser":"deno",c=t.sourcemap===!0?"external":t.sourcemap===!1?void 0:t.sourcemap,u={entrypoints:i,outputDir:n,format:"esm",codeSplitting:t.codeSplitting,minify:t.minify,platform:a,sourcemap:c};t.external!==void 0&&(u.external=t.external),ve.debug("Calling Deno.bundle",{entrypoints:i.slice(0,3),outputDir:n,external:u.external,platform:u.platform});let l=await Deno.bundle(u);if(ve.debug("Deno.bundle result",{success:l.success,errors:l.errors?.length??0}),!l.success){let f=(l.errors??[]).map(d=>({message:d.text??this.extractErrorMessage(d),severity:"error"}));return Q(f)}return await this.processOutput(n,t,s,r)}catch(r){return Q([{message:r instanceof Error?r.message:String(r),severity:"fatal"}])}finally{try{await o.fs.remove(n,{recursive:!0})}catch{}}}watch(t,n){let r=!0,s=Object.values(t.entrypoints).map(u=>o.path.dirname(u)),i=[...new Set(s)],a=Deno.watchFs(i,{recursive:!0});return(async()=>{for await(let u of a){if(!r)break;let l=await this.bundle(t);n(l)}})().catch(u=>{console.error("Watch loop error:",u)}),Promise.resolve({stop:()=>(r=!1,a.close(),Promise.resolve())})}extractErrorMessage(t){return t==null?"Unknown error":typeof t=="object"&&"message"in t?String(t.message):String(t)}async processOutput(t,n,r,s){let i=this.options.entryName??"main",a=new Map,c={},u={},l=null,p=0,f=new Map,d=new Map;for(let b=0;b<s.length;b++){let w=s[b],x=r[b];if(w!==void 0&&x!==void 0){let P=o.path.basename(w).replace(/\.[^.]+$/,"");f.set(P,x),d.set(z(w,".js"),x)}}let m=o.path.join(t,"dist"),h=t;try{(await o.fs.stat(m)).isDirectory&&(h=m)}catch{}let y=[];ve.debug(`Scanning output dir: ${h}`);let C=async(b,w="")=>{for await(let x of o.fs.readDir(b)){let P=o.path.join(b,x.name),F=w?`${w}/${x.name}`:x.name;x.isDirectory?await C(P,F):x.isFile&&(x.name.endsWith(".js")||x.name.endsWith(".map"))&&y.push({name:F,path:P})}};if(await C(h),h!==t){for await(let b of o.fs.readDir(t))if(b.isFile&&(b.name.endsWith(".js")||b.name.endsWith(".map"))&&(b.name.startsWith("chunk-")||b.name.endsWith(".map"))){let w=o.path.join(t,b.name);y.some(x=>x.path===w)||y.push({name:b.name,path:w})}}ve.debug(`Found ${y.length} output files`,y.map(b=>b.name));let R=new Map;for(let b of y)if(b.name.endsWith(".map")){let w=await o.fs.readFile(b.path),x=b.name;b.name.startsWith("_client-entry")?x=`${i}.js.map`:b.name.startsWith("_build-id-entry")&&(x="build-id.js.map"),R.set(x,w)}for(let b of y){if(b.name.endsWith(".map"))continue;let w=await o.fs.readTextFile(b.path);n.basePath!==void 0&&(w=w.replace(/\/_lime\/alive/g,`${n.basePath}/_lime/alive`)),n.define!==void 0&&(w=Zn(w,n.define)),w=w.replace(/from\s
|
|
81
|
-
//# sourceMappingURL=${i}.js.map`));let F=new TextEncoder().encode(w),de=await this.computeHash(F),D=this.parseImports(w),Me=`${x}.map`,Y=R.get(Me);a.set(x,{path:x,code:F,map:Y,size:F.length,hash:de,isEntry:!x.startsWith("chunk-")}),p+=F.length,c[x]={bytes:F.length,inputs:{},imports:D.map(j=>({path:j,kind:"import-statement"}))}}for(let[b,w]of R)if(!a.has(b)){let x=await this.computeHash(w);a.set(b,{path:b,code:w,size:w.length,hash:x,isEntry:!1}),p+=w.length}if(n.outputDir!==void 0){await o.fs.mkdir(n.outputDir,{recursive:!0});for(let[b,w]of a){let x=o.path.join(n.outputDir,b),P=o.path.dirname(x);P!==n.outputDir&&await o.fs.mkdir(P,{recursive:!0}),await o.fs.writeFile(x,w.code)}}for(let[b,w]of Object.entries(n.entrypoints)){if(b==="client"||b==="main")continue;let x=await this.findEntrypointChunks(b,h,t,a);x.length>0&&(u[w]=x)}return Ce(a,{metafile:{inputs:{},outputs:c},entrypointManifest:u,entrypoint:l??"main.js",totalSize:p})}async findEntrypointChunks(t,n,r,s){let i=z(t,".js"),a=o.path.join(n,i),c=null;try{c=await o.fs.readTextFile(a)}catch{try{let u=o.path.join(r,"dist",i);c=await o.fs.readTextFile(u)}catch{}}return c!==null?this.extractChunksFromProxyFile(c,s):this.findChunksForComponentName(t,s)}findChunksForComponentName(t,n){let r=[],s=o.path.basename(t).replace(/\.[^.]+$/,""),i=s.charAt(0).toUpperCase()+s.slice(1).replace(/-([a-z])/g,(a,c)=>c.toUpperCase());for(let[a,c]of n){if(!a.startsWith("chunk-")||!a.endsWith(".js"))continue;let u=new TextDecoder().decode(c.code);if([new RegExp(`export\\s*\\{[^}]*\\b${i}\\b[^}]*\\}`),new RegExp(`export\\s+(?:function|const|let|var|class)\\s+${i}\\b`),new RegExp(`\\b\\w+\\s+as\\s+${i}\\b`)].some(f=>f.test(u))){r.unshift(a);let f=/from\s*["']\.?\/?([^"']*chunk-[A-Z0-9]+\.js)["']/gi,d;for(;(d=f.exec(u))!==null;){let m=o.path.basename(d[1]??"");m&&!r.includes(m)&&r.push(m)}break}}return r}extractChunksFromProxyFile(t,n){let r=[],s=/import(?:\{[\w\s,]{0,500}\})?\s{0,100}from\s{0,100}["']([\w./-]*chunk-[A-Z0-9]+\.js)["']/gi,i=/import\s{0,100}["']([\w./-]*chunk-[A-Z0-9]+\.js)["']/gi,a;for(;(a=s.exec(t))!==null;){let u=a[1];if(u!==void 0){let l=o.path.basename(u);r.includes(l)||r.push(l)}}for(;(a=i.exec(t))!==null;){let u=a[1];if(u!==void 0){let l=o.path.basename(u);r.includes(l)||r.push(l)}}let c=t.match(/export\s*\{([\w\s,]+)\}/);if(c!==null){let p=c[1]?.match(/(\w+)(?:\s+as\s+\w+)?/)?.[1]??null;if(p!==null){let f=null;for(let[d,m]of n){if(!d.startsWith("chunk-")||!d.endsWith(".js"))continue;let h=new TextDecoder().decode(m.code);if([new RegExp(`export\\s*\\{[^}]*\\b${p}\\b[^}]*\\}`),new RegExp(`export\\s+(?:function|const|let|var|class)\\s+${p}\\b`),new RegExp(`\\b\\w+\\s+as\\s+${p}\\b`)].some(R=>R.test(h))){f=d;break}}if(f!==null){let d=r.indexOf(f);d>0?(r.splice(d,1),r.unshift(f)):d===-1&&r.unshift(f)}}}return r}async computeHash(t){let n=await crypto.subtle.digest("SHA-256",t);return be(new Uint8Array(n)).slice(0,16)}parseImports(t){let n=[],r=/import\s{1,100}[^\n"']{1,500}\s{1,100}from\s{0,100}["']([\w./@-]+)["']/g,s;for(;(s=r.exec(t))!==null;){let a=s[1];if(a!==void 0&&(a.startsWith("./")||a.startsWith("../")||a.startsWith("/"))){let c=a.startsWith("./")?a.slice(2):a.startsWith("../")?a:a.slice(1);n.push(c)}}let i=/import\s*\(\s*["']([^"']+)["']\s*\)/g;for(;(s=i.exec(t))!==null;){let a=s[1];if(a!==void 0&&(a.startsWith("./")||a.startsWith("../")||a.startsWith("/"))){let c=a.startsWith("./")?a.slice(2):a.startsWith("../")?a:a.slice(1);n.push(c)}}return[...new Set(n)]}};function Zn(e,t){let n=Object.keys(t);if(n.length===0)return e;n.sort((a,c)=>c.length-a.length);let r=!1;for(let a of n)if(e.includes(a)){r=!0;break}if(!r)return e;let s=n.map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),i=new RegExp(`\\b(${s.join("|")})\\b`,"g");return e.replace(i,a=>t[a]??a)}var ze=(e={})=>new Se(e);function Qn(e){let t=Object.keys(e).sort((s,i)=>i.length-s.length);if(t.length===0)return{name:"define"};let n=t.map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),r=new RegExp(`\\b(${n.join("|")})\\b`,"g");return{name:"define",transform(s,i){if(i.includes("node_modules"))return null;let a=!1;for(let u of t)if(s.includes(u)){a=!0;break}if(!a)return null;let c=s.replace(r,u=>e[u]??u);return c===s?null:{code:c}}}}var Re=class{name="rolldown";options;rolldownModule=null;constructor(t={}){this.options=t}async bundle(t){try{let n=await this.loadRolldown(),r=this.adaptPlugins(t.plugins);t.define!==void 0&&Object.keys(t.define).length>0&&r.push(Qn(t.define));let s=t.projectRoot!==void 0?[`${t.projectRoot}/node_modules`,"node_modules"]:["node_modules"],i=await n.rolldown({input:t.entrypoints,external:t.external,plugins:r,resolve:{modules:s}}),a=t.sourcemap===!0?!0:t.sourcemap==="inline"?"inline":t.sourcemap==="external"?!0:void 0,c={dir:t.outputDir,format:t.format,entryFileNames:"[name].js",chunkFileNames:"chunk-[hash].js",sourcemap:a,minify:t.minify,...this.options.advancedChunks!==void 0?{advancedChunks:{minSize:this.options.advancedChunks.minSize??2e4,groups:this.options.advancedChunks.groups?.map(l=>({name:l.name,test:l.test,priority:l.priority??0}))}}:{}},u=await i.write(c);return await i.close(),await this.processRolldownOutput(u,t)}catch(n){return Q([{message:n instanceof Error?n.message:String(n),severity:"fatal"}])}}async watch(t,n){let s=await(await this.loadRolldown()).watch({input:t.entrypoints,external:t.external,plugins:this.adaptPlugins(t.plugins),output:{dir:t.outputDir,format:t.format,entryFileNames:"[name].js",chunkFileNames:"chunk-[hash].js",sourcemap:t.sourcemap===!0||t.sourcemap==="external",minify:t.minify}});return s.on("event",async i=>{if(i.code==="BUNDLE_END"){let a=await this.bundle(t);n(a)}else i.code==="ERROR"&&n(Q([{message:i.error?.message??"Watch error",severity:"error"}]))}),{stop:async()=>{await s.close()}}}async loadRolldown(){if(this.rolldownModule!==null)return this.rolldownModule;try{let t=await import("npm:rolldown@latest"),n={rolldown:r=>t.rolldown(r),watch:r=>{let s=t.watch(r);return Promise.resolve(s)}};return this.rolldownModule=n,n}catch(t){throw new Error(`Failed to load Rolldown. Make sure it's installed: ${t instanceof Error?t.message:String(t)}`)}}adaptPlugins(t){return t===void 0||t.length===0?[]:t.map(n=>{let r={name:n.name},s={resolvers:[],loaders:[],transformers:[]},i=n.setup({onResolve:(a,c)=>{s.resolvers.push({options:a,callback:c})},onLoad:(a,c)=>{s.loaders.push({options:a,callback:c})},onTransform:(a,c)=>{s.transformers.push({options:a,callback:c})}});return i instanceof Promise&&(r.buildStart=async function(){await i}),r.resolveId=async(a,c)=>{for(let u of s.resolvers)if(u.options.filter.test(a)){let l=await u.callback({path:a,importer:c??"",namespace:u.options.namespace??"file",kind:"import-statement"});if(l?.path!==void 0||l?.external===!0)return{id:l.path??a,external:l.external}}return null},r.load=async a=>{for(let c of s.loaders)if(c.options.filter.test(a)){let u=await c.callback({path:a,namespace:c.options.namespace??"file"});if(u?.contents!==void 0)return{code:typeof u.contents=="string"?u.contents:new TextDecoder().decode(u.contents)}}return null},r.transform=async(a,c)=>{let u=a;for(let l of s.transformers)if(l.options.filter.test(c)){let p=await l.callback({path:c,code:u});p?.code!==void 0&&(u=p.code)}return u!==a?{code:u}:null},r})}async processRolldownOutput(t,n){let s=`${this.options.entryName??"main"}.js`,i=new Map,a={},c={},u=null,l=0;for(let d of t.output)if(d.type==="chunk"){let m=d.code;n.basePath!==void 0&&(m=m.replace(/\/_lime\/alive/g,`${n.basePath}/_lime/alive`));let h=new TextEncoder().encode(m),y=await this.computeHash(h),C={path:d.fileName,code:h,size:h.length,hash:y,isEntry:d.isEntry,...d.map!==void 0?{map:new TextEncoder().encode(JSON.stringify(d.map))}:{}};if(i.set(d.fileName,C),l+=h.length,d.isEntry&&(d.fileName===s||u===null)&&(u=d.fileName),d.isEntry&&d.facadeModuleId!==void 0){let R=[d.fileName];if(d.imports!==void 0)for(let E of d.imports)R.includes(E)||R.push(E);c[d.facadeModuleId]=R}a[d.fileName]={bytes:h.length,inputs:{},imports:(d.imports??[]).map(R=>({path:R,kind:"import-statement"})),...d.isEntry&&d.facadeModuleId!==void 0?{entryPoint:d.facadeModuleId}:{}}}else if(d.type==="asset"){let m=typeof d.source=="string"?new TextEncoder().encode(d.source):d.source,h=await this.computeHash(m);i.set(d.fileName,{path:d.fileName,code:m,size:m.length,hash:h}),l+=m.length}return Ce(i,{metafile:{inputs:{},outputs:a},entrypointManifest:c,entrypoint:u??s,totalSize:l})}async computeHash(t){let n=await crypto.subtle.digest("SHA-256",t);return be(new Uint8Array(n)).slice(0,16)}},Le=(e={})=>new Re(e);function Pe(e,t){if(typeof e=="object"&&e!==null&&"backend"in e){let r=e;return Pe(r.backend,r.options)}let n=e??"rolldown";switch(n){case"rolldown":return Le(t);case"deno-bundler":return ze(t);default:throw new Error(`Unknown bundler backend: ${n}`)}}var O=S.getLogger(["laroux-bundler","bundler"]);function Yn(e,t){let n={},r=0;for(let[s,i]of e.outputs)n[s]={fileName:s,size:i.size},r+=i.size;return{entrypoint:e.entrypoint??"client.js",outputs:n,manifest:t,totalSize:e.totalSize??r}}function er(e){let t=Object.values(e.outputs);if(t.length===0)return{chunkCount:0,largestChunk:{name:"",size:0},smallestChunk:{name:"",size:0},averageChunkSize:0};let n=t.sort((i,a)=>a.size-i.size),r=n[0],s=n[n.length-1];return{chunkCount:t.length,largestChunk:r?{name:r.fileName,size:r.size}:{name:"",size:0},smallestChunk:s?{name:s.fileName,size:s.size}:{name:"",size:0},averageChunkSize:t.length>0?e.totalSize/t.length:0}}function At(e){let t=er(e);O.debug("\u{1F4CA} Bundle Statistics:",{totalSizeKB:(e.totalSize/1024).toFixed(2),chunkCount:t.chunkCount,largestChunk:{name:t.largestChunk.name,sizeKB:(t.largestChunk.size/1024).toFixed(2)},smallestChunk:{name:t.smallestChunk.name,sizeKB:(t.smallestChunk.size/1024).toFixed(2)},averageChunkSizeKB:(t.averageChunkSize/1024).toFixed(2)})}async function zt(e,t,n){O.info(`\u{1F4E6} Using bundler backend: ${n}`),O.debug(`Bundling with @eser/bundler (${n})...`),O.debug(` Entrypoints: ${e.entrypoints.length}`),O.debug(` Output: ${e.outputDir}`),O.debug(`Creating bundler: ${n}`);let r=Pe(n,{entryName:"client"}),s={};for(let l=0;l<e.entrypoints.length;l++){let p=e.entrypoints[l];if(p!==void 0)if(l===0)s.client=p;else{let f=t.find(d=>d.filePath===p);f!==void 0?s[f.relativePath]=p:s[`entry-${l}`]=p}}let i=e.sourcemap===!0||e.sourcemap==="external"||e.sourcemap==="inline",a={entrypoints:s,outputDir:e.outputDir,projectRoot:e.projectRoot,format:"esm",platform:e.platform==="deno"?"node":"browser",codeSplitting:e.splitting!==!1,minify:e.minify??!1,sourcemap:i,plugins:e.plugins,define:e.define},c=await r.bundle(a);if(!c.success){let l=c.errors?.map(p=>p.message).join(`
|
|
80
|
+
`),i.unshift(p)}let a=t.platform==="browser"?"browser":"deno",c=t.sourcemap===!0?"external":t.sourcemap===!1?void 0:t.sourcemap,u={entrypoints:i,outputDir:n,format:"esm",codeSplitting:t.codeSplitting,minify:t.minify,platform:a,sourcemap:c};t.external!==void 0&&(u.external=t.external),ve.debug("Calling Deno.bundle",{entrypoints:i.slice(0,3),outputDir:n,external:u.external,platform:u.platform});let l=await Deno.bundle(u);if(ve.debug("Deno.bundle result",{success:l.success,errors:l.errors?.length??0}),!l.success){let f=(l.errors??[]).map(d=>({message:d.text??this.extractErrorMessage(d),severity:"error"}));return Q(f)}return await this.processOutput(n,t,s,r)}catch(r){return Q([{message:r instanceof Error?r.message:String(r),severity:"fatal"}])}finally{try{await o.fs.remove(n,{recursive:!0})}catch{}}}watch(t,n){let r=!0,s=Object.values(t.entrypoints).map(u=>o.path.dirname(u)),i=[...new Set(s)],a=Deno.watchFs(i,{recursive:!0});return(async()=>{for await(let u of a){if(!r)break;let l=await this.bundle(t);n(l)}})().catch(u=>{console.error("Watch loop error:",u)}),Promise.resolve({stop:()=>(r=!1,a.close(),Promise.resolve())})}extractErrorMessage(t){return t==null?"Unknown error":typeof t=="object"&&"message"in t?String(t.message):String(t)}async processOutput(t,n,r,s){let i=this.options.entryName??"main",a=new Map,c={},u={},l=null,p=0,f=new Map,d=new Map;for(let b=0;b<s.length;b++){let w=s[b],x=r[b];if(w!==void 0&&x!==void 0){let P=o.path.basename(w).replace(/\.[^.]+$/,"");f.set(P,x),d.set(z(w,".js"),x)}}let m=o.path.join(t,"dist"),h=t;try{(await o.fs.stat(m)).isDirectory&&(h=m)}catch{}let y=[];ve.debug(`Scanning output dir: ${h}`);let C=async(b,w="")=>{for await(let x of o.fs.readDir(b)){let P=o.path.join(b,x.name),F=w?`${w}/${x.name}`:x.name;x.isDirectory?await C(P,F):x.isFile&&(x.name.endsWith(".js")||x.name.endsWith(".map"))&&y.push({name:F,path:P})}};if(await C(h),h!==t){for await(let b of o.fs.readDir(t))if(b.isFile&&(b.name.endsWith(".js")||b.name.endsWith(".map"))&&(b.name.startsWith("chunk-")||b.name.endsWith(".map"))){let w=o.path.join(t,b.name);y.some(x=>x.path===w)||y.push({name:b.name,path:w})}}ve.debug(`Found ${y.length} output files`,y.map(b=>b.name));let R=new Map;for(let b of y)if(b.name.endsWith(".map")){let w=await o.fs.readFile(b.path),x=b.name;b.name.startsWith("_client-entry")?x=`${i}.js.map`:b.name.startsWith("_build-id-entry")&&(x="build-id.js.map"),R.set(x,w)}for(let b of y){if(b.name.endsWith(".map"))continue;let w=await o.fs.readTextFile(b.path);n.basePath!==void 0&&(w=w.replace(/\/_lime\/alive/g,`${n.basePath}/_lime/alive`)),n.define!==void 0&&(w=Zn(w,n.define)),w=w.replace(/from\s{0,5}["']\.\.\/chunk-/g,'from"./chunk-'),w=w.replace(/from\s{0,5}["']\.\.chunk-/g,'from"./chunk-'),w=w.replace(/import\s{0,5}\(["']\.\.\/chunk-/g,'import("./chunk-'),w=w.replace(/import\s{0,5}\(["']\.\.chunk-/g,'import("./chunk-');let x=b.name,P=x.startsWith("_client-entry");if(P)x=`${i}.js`,l=`${i}.js`;else if(x.startsWith("_build-id-entry"))x="build-id.js";else if(!x.startsWith("chunk-")){let j;for(let[ee,Fe]of d)if(ee.endsWith(x)){j=Fe;break}if(j===void 0){let ee=o.path.basename(x).replace(/\.js$/,"");j=f.get(ee)}j!==void 0&&(x=`${j}.js`)}P&&R.has(`${i}.js.map`)&&(w=w.replace(/\/\/# sourceMappingURL=.*$/m,`//# sourceMappingURL=${i}.js.map`),w.includes("//# sourceMappingURL=")||(w+=`
|
|
81
|
+
//# sourceMappingURL=${i}.js.map`));let F=new TextEncoder().encode(w),de=await this.computeHash(F),D=this.parseImports(w),Me=`${x}.map`,Y=R.get(Me);a.set(x,{path:x,code:F,map:Y,size:F.length,hash:de,isEntry:!x.startsWith("chunk-")}),p+=F.length,c[x]={bytes:F.length,inputs:{},imports:D.map(j=>({path:j,kind:"import-statement"}))}}for(let[b,w]of R)if(!a.has(b)){let x=await this.computeHash(w);a.set(b,{path:b,code:w,size:w.length,hash:x,isEntry:!1}),p+=w.length}if(n.outputDir!==void 0){await o.fs.mkdir(n.outputDir,{recursive:!0});for(let[b,w]of a){let x=o.path.join(n.outputDir,b),P=o.path.dirname(x);P!==n.outputDir&&await o.fs.mkdir(P,{recursive:!0}),await o.fs.writeFile(x,w.code)}}for(let[b,w]of Object.entries(n.entrypoints)){if(b==="client"||b==="main")continue;let x=await this.findEntrypointChunks(b,h,t,a);x.length>0&&(u[w]=x)}return Ce(a,{metafile:{inputs:{},outputs:c},entrypointManifest:u,entrypoint:l??"main.js",totalSize:p})}async findEntrypointChunks(t,n,r,s){let i=z(t,".js"),a=o.path.join(n,i),c=null;try{c=await o.fs.readTextFile(a)}catch{try{let u=o.path.join(r,"dist",i);c=await o.fs.readTextFile(u)}catch{}}return c!==null?this.extractChunksFromProxyFile(c,s):this.findChunksForComponentName(t,s)}findChunksForComponentName(t,n){let r=[],s=o.path.basename(t).replace(/\.[^.]+$/,""),i=s.charAt(0).toUpperCase()+s.slice(1).replace(/-([a-z])/g,(a,c)=>c.toUpperCase());for(let[a,c]of n){if(!a.startsWith("chunk-")||!a.endsWith(".js"))continue;let u=new TextDecoder().decode(c.code);if([new RegExp(`export\\s{0,5}\\{[^}]*\\b${i}\\b[^}]*\\}`),new RegExp(`export\\s+(?:function|const|let|var|class)\\s+${i}\\b`),new RegExp(`\\b\\w+\\s+as\\s+${i}\\b`)].some(f=>f.test(u))){r.unshift(a);let f=/from\s{0,5}["']\.?\/?([^"']*chunk-[A-Z0-9]+\.js)["']/gi,d;for(;(d=f.exec(u))!==null;){let m=o.path.basename(d[1]??"");m&&!r.includes(m)&&r.push(m)}break}}return r}extractChunksFromProxyFile(t,n){let r=[],s=/import(?:\{[\w\s,]{0,500}\})?\s{0,100}from\s{0,100}["']([\w./-]*chunk-[A-Z0-9]+\.js)["']/gi,i=/import\s{0,100}["']([\w./-]*chunk-[A-Z0-9]+\.js)["']/gi,a;for(;(a=s.exec(t))!==null;){let u=a[1];if(u!==void 0){let l=o.path.basename(u);r.includes(l)||r.push(l)}}for(;(a=i.exec(t))!==null;){let u=a[1];if(u!==void 0){let l=o.path.basename(u);r.includes(l)||r.push(l)}}let c=t.match(/export\s{0,5}\{([\w\s,]+)\}/);if(c!==null){let p=c[1]?.match(/(\w+)(?:\s+as\s+\w+)?/)?.[1]??null;if(p!==null){let f=null;for(let[d,m]of n){if(!d.startsWith("chunk-")||!d.endsWith(".js"))continue;let h=new TextDecoder().decode(m.code);if([new RegExp(`export\\s{0,5}\\{[^}]*\\b${p}\\b[^}]*\\}`),new RegExp(`export\\s+(?:function|const|let|var|class)\\s+${p}\\b`),new RegExp(`\\b\\w+\\s+as\\s+${p}\\b`)].some(R=>R.test(h))){f=d;break}}if(f!==null){let d=r.indexOf(f);d>0?(r.splice(d,1),r.unshift(f)):d===-1&&r.unshift(f)}}}return r}async computeHash(t){let n=await crypto.subtle.digest("SHA-256",t);return be(new Uint8Array(n)).slice(0,16)}parseImports(t){let n=[],r=/import\s{1,100}[^\n"']{1,500}\s{1,100}from\s{0,100}["']([\w./@-]+)["']/g,s;for(;(s=r.exec(t))!==null;){let a=s[1];if(a!==void 0&&(a.startsWith("./")||a.startsWith("../")||a.startsWith("/"))){let c=a.startsWith("./")?a.slice(2):a.startsWith("../")?a:a.slice(1);n.push(c)}}let i=/import\s{0,5}\(\s{0,5}["']([^"']+)["']\s{0,5}\)/g;for(;(s=i.exec(t))!==null;){let a=s[1];if(a!==void 0&&(a.startsWith("./")||a.startsWith("../")||a.startsWith("/"))){let c=a.startsWith("./")?a.slice(2):a.startsWith("../")?a:a.slice(1);n.push(c)}}return[...new Set(n)]}};function Zn(e,t){let n=Object.keys(t);if(n.length===0)return e;n.sort((a,c)=>c.length-a.length);let r=!1;for(let a of n)if(e.includes(a)){r=!0;break}if(!r)return e;let s=n.map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),i=new RegExp(`\\b(${s.join("|")})\\b`,"g");return e.replace(i,a=>t[a]??a)}var ze=(e={})=>new Se(e);function Qn(e){let t=Object.keys(e).sort((s,i)=>i.length-s.length);if(t.length===0)return{name:"define"};let n=t.map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),r=new RegExp(`\\b(${n.join("|")})\\b`,"g");return{name:"define",transform(s,i){if(i.includes("node_modules"))return null;let a=!1;for(let u of t)if(s.includes(u)){a=!0;break}if(!a)return null;let c=s.replace(r,u=>e[u]??u);return c===s?null:{code:c}}}}var Re=class{name="rolldown";options;rolldownModule=null;constructor(t={}){this.options=t}async bundle(t){try{let n=await this.loadRolldown(),r=this.adaptPlugins(t.plugins);t.define!==void 0&&Object.keys(t.define).length>0&&r.push(Qn(t.define));let s=t.projectRoot!==void 0?[`${t.projectRoot}/node_modules`,"node_modules"]:["node_modules"],i=await n.rolldown({input:t.entrypoints,external:t.external,plugins:r,resolve:{modules:s}}),a=t.sourcemap===!0?!0:t.sourcemap==="inline"?"inline":t.sourcemap==="external"?!0:void 0,c={dir:t.outputDir,format:t.format,entryFileNames:"[name].js",chunkFileNames:"chunk-[hash].js",sourcemap:a,minify:t.minify,...this.options.advancedChunks!==void 0?{advancedChunks:{minSize:this.options.advancedChunks.minSize??2e4,groups:this.options.advancedChunks.groups?.map(l=>({name:l.name,test:l.test,priority:l.priority??0}))}}:{}},u=await i.write(c);return await i.close(),await this.processRolldownOutput(u,t)}catch(n){return Q([{message:n instanceof Error?n.message:String(n),severity:"fatal"}])}}async watch(t,n){let s=await(await this.loadRolldown()).watch({input:t.entrypoints,external:t.external,plugins:this.adaptPlugins(t.plugins),output:{dir:t.outputDir,format:t.format,entryFileNames:"[name].js",chunkFileNames:"chunk-[hash].js",sourcemap:t.sourcemap===!0||t.sourcemap==="external",minify:t.minify}});return s.on("event",async i=>{if(i.code==="BUNDLE_END"){let a=await this.bundle(t);n(a)}else i.code==="ERROR"&&n(Q([{message:i.error?.message??"Watch error",severity:"error"}]))}),{stop:async()=>{await s.close()}}}async loadRolldown(){if(this.rolldownModule!==null)return this.rolldownModule;try{let t=await import("npm:rolldown@latest"),n={rolldown:r=>t.rolldown(r),watch:r=>{let s=t.watch(r);return Promise.resolve(s)}};return this.rolldownModule=n,n}catch(t){throw new Error(`Failed to load Rolldown. Make sure it's installed: ${t instanceof Error?t.message:String(t)}`)}}adaptPlugins(t){return t===void 0||t.length===0?[]:t.map(n=>{let r={name:n.name},s={resolvers:[],loaders:[],transformers:[]},i=n.setup({onResolve:(a,c)=>{s.resolvers.push({options:a,callback:c})},onLoad:(a,c)=>{s.loaders.push({options:a,callback:c})},onTransform:(a,c)=>{s.transformers.push({options:a,callback:c})}});return i instanceof Promise&&(r.buildStart=async function(){await i}),r.resolveId=async(a,c)=>{for(let u of s.resolvers)if(u.options.filter.test(a)){let l=await u.callback({path:a,importer:c??"",namespace:u.options.namespace??"file",kind:"import-statement"});if(l?.path!==void 0||l?.external===!0)return{id:l.path??a,external:l.external}}return null},r.load=async a=>{for(let c of s.loaders)if(c.options.filter.test(a)){let u=await c.callback({path:a,namespace:c.options.namespace??"file"});if(u?.contents!==void 0)return{code:typeof u.contents=="string"?u.contents:new TextDecoder().decode(u.contents)}}return null},r.transform=async(a,c)=>{let u=a;for(let l of s.transformers)if(l.options.filter.test(c)){let p=await l.callback({path:c,code:u});p?.code!==void 0&&(u=p.code)}return u!==a?{code:u}:null},r})}async processRolldownOutput(t,n){let s=`${this.options.entryName??"main"}.js`,i=new Map,a={},c={},u=null,l=0;for(let d of t.output)if(d.type==="chunk"){let m=d.code;n.basePath!==void 0&&(m=m.replace(/\/_lime\/alive/g,`${n.basePath}/_lime/alive`));let h=new TextEncoder().encode(m),y=await this.computeHash(h),C={path:d.fileName,code:h,size:h.length,hash:y,isEntry:d.isEntry,...d.map!==void 0?{map:new TextEncoder().encode(JSON.stringify(d.map))}:{}};if(i.set(d.fileName,C),l+=h.length,d.isEntry&&(d.fileName===s||u===null)&&(u=d.fileName),d.isEntry&&d.facadeModuleId!==void 0){let R=[d.fileName];if(d.imports!==void 0)for(let E of d.imports)R.includes(E)||R.push(E);c[d.facadeModuleId]=R}a[d.fileName]={bytes:h.length,inputs:{},imports:(d.imports??[]).map(R=>({path:R,kind:"import-statement"})),...d.isEntry&&d.facadeModuleId!==void 0?{entryPoint:d.facadeModuleId}:{}}}else if(d.type==="asset"){let m=typeof d.source=="string"?new TextEncoder().encode(d.source):d.source,h=await this.computeHash(m);i.set(d.fileName,{path:d.fileName,code:m,size:m.length,hash:h}),l+=m.length}return Ce(i,{metafile:{inputs:{},outputs:a},entrypointManifest:c,entrypoint:u??s,totalSize:l})}async computeHash(t){let n=await crypto.subtle.digest("SHA-256",t);return be(new Uint8Array(n)).slice(0,16)}},Le=(e={})=>new Re(e);function Pe(e,t){if(typeof e=="object"&&e!==null&&"backend"in e){let r=e;return Pe(r.backend,r.options)}let n=e??"rolldown";switch(n){case"rolldown":return Le(t);case"deno-bundler":return ze(t);default:throw new Error(`Unknown bundler backend: ${n}`)}}var O=S.getLogger(["laroux-bundler","bundler"]);function Yn(e,t){let n={},r=0;for(let[s,i]of e.outputs)n[s]={fileName:s,size:i.size},r+=i.size;return{entrypoint:e.entrypoint??"client.js",outputs:n,manifest:t,totalSize:e.totalSize??r}}function er(e){let t=Object.values(e.outputs);if(t.length===0)return{chunkCount:0,largestChunk:{name:"",size:0},smallestChunk:{name:"",size:0},averageChunkSize:0};let n=t.sort((i,a)=>a.size-i.size),r=n[0],s=n[n.length-1];return{chunkCount:t.length,largestChunk:r?{name:r.fileName,size:r.size}:{name:"",size:0},smallestChunk:s?{name:s.fileName,size:s.size}:{name:"",size:0},averageChunkSize:t.length>0?e.totalSize/t.length:0}}function At(e){let t=er(e);O.debug("\u{1F4CA} Bundle Statistics:",{totalSizeKB:(e.totalSize/1024).toFixed(2),chunkCount:t.chunkCount,largestChunk:{name:t.largestChunk.name,sizeKB:(t.largestChunk.size/1024).toFixed(2)},smallestChunk:{name:t.smallestChunk.name,sizeKB:(t.smallestChunk.size/1024).toFixed(2)},averageChunkSizeKB:(t.averageChunkSize/1024).toFixed(2)})}async function zt(e,t,n){O.info(`\u{1F4E6} Using bundler backend: ${n}`),O.debug(`Bundling with @eser/bundler (${n})...`),O.debug(` Entrypoints: ${e.entrypoints.length}`),O.debug(` Output: ${e.outputDir}`),O.debug(`Creating bundler: ${n}`);let r=Pe(n,{entryName:"client"}),s={};for(let l=0;l<e.entrypoints.length;l++){let p=e.entrypoints[l];if(p!==void 0)if(l===0)s.client=p;else{let f=t.find(d=>d.filePath===p);f!==void 0?s[f.relativePath]=p:s[`entry-${l}`]=p}}let i=e.sourcemap===!0||e.sourcemap==="external"||e.sourcemap==="inline",a={entrypoints:s,outputDir:e.outputDir,projectRoot:e.projectRoot,format:"esm",platform:e.platform==="deno"?"node":"browser",codeSplitting:e.splitting!==!1,minify:e.minify??!1,sourcemap:i,plugins:e.plugins,define:e.define},c=await r.bundle(a);if(!c.success){let l=c.errors?.map(p=>p.message).join(`
|
|
82
82
|
`)??"Unknown error";throw new Error(`Bundle failed: ${l}`)}let u={};for(let l of t){let p=c.entrypointManifest?.[l.filePath]??[];p.length>0&&(u[l.filePath]=[...p])}return O.debug(` Outputs: ${c.outputs.size} files`),O.debug(` Total size: ${((c.totalSize??0)/1024).toFixed(2)} KB`),Yn(c,u)}async function Lt(e,t){O.info(`\u{1F4E6} Bundling server components with ${t}`),O.debug(` Entrypoints: ${e.entrypoints.length}`),O.debug(` Output: ${e.outputDir}`),O.debug(` Externals: ${e.externals?.length??0}`);let n=Pe(t,{entryName:"server"}),r={};for(let c of e.entrypoints){let u=c.replace(e.projectRoot,"").replace(/^\//,"");u=z(u,""),r[u]=c}let s={entrypoints:r,outputDir:e.outputDir,format:"esm",platform:"node",codeSplitting:!1,minify:e.minify??!1,sourcemap:e.sourcemap??!1,external:e.externals,plugins:e.plugins},i=await n.bundle(s);if(!i.success){let c=i.errors?.map(u=>u.message).join(`
|
|
83
83
|
`)??"Unknown error";throw new Error(`Server bundle failed: ${c}`)}let a=new Map;for(let[c,u]of i.outputs)if(u.isEntry&&i.entrypointManifest!==void 0){for(let[l,p]of Object.entries(i.entrypointManifest))if(p.includes(c)){a.set(l,c);break}}return O.debug(` Outputs: ${i.outputs.size} files`),O.debug(` Total size: ${((i.totalSize??0)/1024).toFixed(2)} KB`),{outputMap:a,totalSize:i.totalSize??0,fileCount:i.outputs.size}}var $=S.getLogger(["laroux-bundler","chunk-manifest"]),tr="1.0";function Ut(e,t,n,r,s="info",i=!1){$.debug("\u{1F4CB} Generating chunk manifest...");let a={version:tr,buildId:e,timestamp:t,entrypoint:n.entrypoint,logLevel:s,hmrEnabled:i,chunks:{},files:{}};for(let[u,l]of Object.entries(n.outputs))a.files[l.fileName]={name:l.fileName,size:l.size,hash:sr(l.fileName)??void 0};let c=[];for(let u of r){let l=nr(u,n),[p,...f]=l;if(!p){$.warn(`No chunks found for ${u.relativePath}`);continue}let d=[p,...f];for(let y of d)a.files[y]||c.push(`${u.relativePath} references ${y}, but it's not in bundle outputs`);let m=or(u.relativePath);a.chunks[m]={main:Wt(p),deps:f.map(Wt),size:rr(l,a.files)};let h=u.exportNames[0]??"default";h!=="default"&&(a.chunks[m].exportName=h),$.debug(` ${m} \u2192 main: ${p}, deps: [${f.join(", ")}]`)}if(c.length>0){$.error("\u274C Chunk manifest validation failed!"),$.error(" Missing chunks:");for(let u of c)$.error(` - ${u}`);throw $.error(` Available files: ${Object.keys(a.files).join(", ")}`),new Error(`Chunk manifest validation failed: ${c.length} chunk(s) referenced but not found in bundle outputs`)}return $.debug("\u2705 Manifest generated"),$.debug(` Components: ${Object.keys(a.chunks).length}`),$.debug(` Chunks: ${Object.keys(a.files).length}`),$.debug(" Validation: All referenced chunks exist"),a}function nr(e,t){let n=t.manifest[e.filePath];if(!n||n.length===0)throw $.error(`\u274C No chunk mapping found for component: ${e.filePath}`),$.error(` Available mappings: ${Object.keys(t.manifest).join(", ")}`),new Error(`Chunk manifest incomplete: No chunks found for ${e.relativePath}. This indicates the bundler failed to analyze the component's dependencies.`);return n}function rr(e,t){return e.reduce((n,r)=>{let s=t[r];return n+(s?.size??0)},0)}function sr(e){return e.match(/-([a-f0-9]+)\./i)?.[1]??null}function Wt(e){return e.replace(/^chunk-/,"").replace(/\.js$/,"")}function or(e){let t=`${we}/`;return e.startsWith(t)?e.slice(t.length):e}async function _t(e,t){await o.fs.writeTextFile(t,JSON.stringify(e,null,2)),$.debug(`\u{1F4DD} Chunk manifest saved: ${t}`)}function Jt(e){$.debug("\u{1F4E6} Chunk Manifest:",{entrypoint:e.entrypoint,components:Object.keys(e.chunks).length,files:Object.keys(e.files).length,chunks:Object.fromEntries(Object.entries(e.chunks).map(([t,n])=>[t,{main:n.main,deps:n.deps,exportName:n.exportName,sizeKB:(n.size/1024).toFixed(2)}]))})}var ue={minify:!0,sourceMaps:!1,codeSplitting:!0,define:{"process.env.NODE_ENV":'"production"',"process.env.DEBUG":'"false"'}},_s={minify:!1,sourceMaps:!0,codeSplitting:!1,define:{"process.env.NODE_ENV":'"development"',"process.env.DEBUG":'"false"'}};import{transform as ar}from"lightningcss";import{Buffer as Gt}from"node:buffer";function lr(e){if(e===void 0)return{chrome:90<<16,firefox:88<<16,safari:917504};let t={};return e.chrome!==void 0&&(t.chrome=e.chrome),e.firefox!==void 0&&(t.firefox=e.firefox),e.safari!==void 0&&(t.safari=e.safari),e.edge!==void 0&&(t.edge=e.edge),t}function Ht(e){if(e==null)throw new TypeError(`Expected Uint8Array from Lightning CSS, got ${e===null?"null":"undefined"}`);if(Qe("node")&&typeof Gt<"u"&&Gt.isBuffer(e))return e.toString("utf-8");if(e instanceof Uint8Array)return new TextDecoder().decode(e);if(typeof e=="string")return e;throw new TypeError(`Expected Uint8Array from Lightning CSS, got ${typeof e}`)}function Vt(e,t={}){let{filename:n="styles.css",minify:r=!1,targets:s,cssModules:i=!1,unusedSymbols:a=[]}=t,c={filename:n,code:new TextEncoder().encode(e),minify:r,targets:lr(s),cssModules:i,unusedSymbols:[...a]},u=ar(c),l;if(u.exports!==null&&u.exports!==void 0){l={};for(let[p,f]of Object.entries(u.exports))l[p]={name:f.name,composes:f.composes?.map(d=>({name:d.name,from:d.from!==void 0?String(d.from):void 0}))}}return{code:Ht(u.code),map:u.map!=null?Ht(u.map):void 0,exports:l}}function We(e,t,n={}){return Vt(e,{...n,filename:t,cssModules:!0})}async function Ue(e,t={}){let{generateDts:n=!1,minify:r=!0,targets:s,tailwind:i}=t,a=await o.fs.readTextFile(e);if(i!==void 0){let f=await i.compile(a,e);f!==null&&(a=f.code)}let c=o.path.basename(e),u=We(a,c,{minify:r,targets:s,nesting:!0}),l={};if(u.exports!==void 0)for(let[f,d]of Object.entries(u.exports))l[f]=d.name;let p=n?_e(l):void 0;return{code:u.code,exports:l,dts:p}}function _e(e){return`// This file is auto-generated by CSS modules processor
|
|
84
84
|
declare const styles: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{c as o}from"./chunk-OCPEFZBJ.js";var n=[{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"]}],a=t=>n.map(e=>({...e,extras:o(t,e.id)})),c=(t,e)=>{let r=new Set(e.map(s=>s.questionId));for(let s of t)if(!r.has(s.id))return s;return null},d=t=>{let e=new Set(t.map(r=>r.questionId));return n.every(r=>e.has(r.id))};export{n as a,a as b,c,d};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as D}from"./chunk-GTHXGAMQ.js";import{a as j}from"./chunk-3XJLLDR5.js";import{a as O}from"./chunk-P7WCO724.js";import{a as N}from"./chunk-JYNHFD6B.js";import{t as
|
|
3
|
-
`,z=async(e,n)=>{let t=JSON.parse(JSON.stringify(e.content));for(let[i,o]of Object.entries(n))q(t,i,o);let r=H(t);await
|
|
2
|
+
import{a as D}from"./chunk-GTHXGAMQ.js";import{a as j}from"./chunk-3XJLLDR5.js";import{a as O}from"./chunk-P7WCO724.js";import{a as N}from"./chunk-JYNHFD6B.js";import{t as p}from"./chunk-MRCBHVSB.js";import{e as _}from"./chunk-G6NAG2EK.js";var y={DenoJson:"deno.json",DenoJsonc:"deno.jsonc",JsrJson:"jsr.json",JsrJsonc:"jsr.jsonc",PackageJson:"package.json"},k=[y.DenoJson,y.DenoJsonc,y.JsrJson,y.JsrJsonc,y.PackageJson],T=Symbol.for("baseDir"),F={name:{"deno.json":"name","deno.jsonc":"name","jsr.json":"name","jsr.jsonc":"name","package.json":"name"},version:{"deno.json":"version","deno.jsonc":"version","jsr.json":"version","jsr.jsonc":"version","package.json":"version"},description:{"package.json":"description"},license:{"deno.json":"license","deno.jsonc":"license","package.json":"license"},private:{"package.json":"private"},exports:{"deno.json":"exports","deno.jsonc":"exports","jsr.json":"exports","jsr.jsonc":"exports","package.json":"exports"},workspaces:{"deno.json":"workspace","deno.jsonc":"workspace","package.json":"workspaces"},imports:{"deno.json":"imports","deno.jsonc":"imports"},dependencies:{"package.json":"dependencies"},devDependencies:{"package.json":"devDependencies"}};var M=_(N(),1);var d={Unknown:0,EnvironmentFile:1,Json:2,JsonWithComments:3,Toml:4,Yaml:5};var S={[d.Unknown]:"unknown",[d.EnvironmentFile]:"environment",[d.Json]:"JSON",[d.JsonWithComments]:"JSONC",[d.Toml]:"TOML",[d.Yaml]:"YAML"},h=class extends Error{filepath;format;constructor(n,t,r){super(`Failed to parse ${S[t]??"unknown"} file "${n}": ${r.message}`,{cause:r}),this.name="ConfigParseError",this.filepath=n,this.format=t}};var A=e=>{let n=p.path.extname(e);return n===".json"?d.Json:n===".jsonc"?d.JsonWithComments:n===".yaml"||n===".yml"?d.Yaml:n===".toml"?d.Toml:n===".env"?d.EnvironmentFile:d.Unknown},x=async(e,n)=>{let t=n??A(e),r=await p.fs.readTextFile(e);try{return t===d.Json?{content:JSON.parse(r),filepath:e,format:t}:t===d.JsonWithComments?{content:j(r),filepath:e,format:t}:t===d.Yaml?{content:M.parse(r),filepath:e,format:t}:t===d.Toml?{content:O(r),filepath:e,format:t}:{content:void 0,filepath:e,format:d.Unknown}}catch(i){throw i instanceof Error?new h(e,t,i):new h(e,t,new Error(String(i)))}};var E=(e,n,t)=>{if(e==null)return t;let r=n.length;if(r===0)return e;let i=e;for(let o=0;o<r;o++){if(i==null)return t;let a=n[o];i=i[a]}return i===void 0?t:i};var m=class extends Error{filepath;constructor(n,t,r){super(n,{cause:r}),this.name="PackageLoadError",this.filepath=t}},$=async(e,n)=>{if(await p.fs.exists(e)===!1||(await p.fs.stat(e)).isFile===!1)return;let i=await p.fs.readTextFile(e),a=(await x(e)).content;if(a!==void 0)return{filepath:e,fileType:n,content:a,rawText:i}},Y=async(e,n)=>{let t=[];for(let r of n){let i=p.path.join(e,r),o=await $(i,r);o&&t.push(o)}return t},B=(e,n)=>E(e,n.split(".")),u=(e,n,t)=>{let r,i,o=[];for(let a of n){let l=t[e]?.[a.fileType];if(l===void 0)continue;let s=B(a.content,l);if(s===void 0)continue;let c={filepath:a.filepath,fileType:a.fileType,propertyPath:l};r===void 0?(r=s,i=c):o.push(c)}if(!(r===void 0||i===void 0))return{value:r,origin:i,alternateOrigins:o}},G=e=>e===void 0?F:D(F,e),K=e=>[...e].sort((n,t)=>k.indexOf(n)-k.indexOf(t)),P=async(e={})=>{let{baseDir:n=".",includeFiles:t=k,fieldMappings:r,searchParents:i=!1}=e,o=G(r),a=K(t),l=p.path.resolve(n),s=[];for(;s=await Y(l,a),!(s.length>0||!i);){let g=p.path.dirname(l);if(g===l)break;l=g}if(s.length===0)throw new m(`No config files found in ${n}. Looked for: ${a.join(", ")}`);return{name:u("name",s,o),version:u("version",s,o),description:u("description",s,o),license:u("license",s,o),private:u("private",s,o),exports:u("exports",s,o),workspaces:u("workspaces",s,o),imports:u("imports",s,o),dependencies:u("dependencies",s,o),devDependencies:u("devDependencies",s,o),[T]:l,_loadedFiles:s}},v=async(e={})=>{try{return await P(e)}catch(n){if(n instanceof m)return;throw n}},R=(e,n)=>{let t=e[n];if(!t)return[];let r=new Set([t.origin.filepath,...t.alternateOrigins.map(i=>i.filepath)]);return e._loadedFiles.filter(i=>r.has(i.filepath))},L=e=>e[T];var V=(e,n)=>{let t=n.split("."),r=e;for(let i of t){if(r==null||typeof r!="object")return;r=r[i]}return r},b=new Set(["__proto__","constructor","prototype"]),q=(e,n,t)=>{let r=n.split("."),i=e;for(let a=0;a<r.length-1;a++){let l=r[a];if(l===void 0||b.has(l))return;if(!Object.hasOwn(i,l)||typeof i[l]!="object"||i[l]===null){let s=Object.create(null);i[l]=s}i=i[l]}let o=r[r.length-1];o!==void 0&&!b.has(o)&&(i[o]=t)},H=e=>`${JSON.stringify(e,null,2)}
|
|
3
|
+
`,z=async(e,n)=>{let t=JSON.parse(JSON.stringify(e.content));for(let[i,o]of Object.entries(n))q(t,i,o);let r=H(t);await p.fs.writeTextFile(e.filepath,r),e.content=t,e.rawText=r},Q=(e,n,t)=>{let{targetFiles:r="all",createIfMissing:i=!1}=t,o=e[n];if(r==="origin"){if(o===void 0){let s=e._loadedFiles[0];return i&&s!==void 0?[s]:[]}let l=e._loadedFiles.find(s=>s.filepath===o.origin.filepath);return l?[l]:[]}if(r==="all")return!o&&!i?[]:!o&&i?[...e._loadedFiles]:R(e,n);let a=new Set(r);return e._loadedFiles.filter(l=>a.has(l.fileType))},J=async(e,n,t,r={})=>{let i=[],o=[],a=[],l=Q(e,n,r);if(l.length===0)return{updated:i,failed:o,skipped:a};for(let s of l){let c=F[n]?.[s.fileType];if(!c){a.push(s.filepath);continue}if(V(s.content,c)===t){a.push(s.filepath);continue}try{await z(s,{[c]:t}),i.push(s.filepath)}catch(f){o.push({filepath:s.filepath,reason:f instanceof Error?f.message:String(f)})}}if(i.length>0){let s=e[n];if(s)s.value=t;else{let c=e._loadedFiles.find(g=>i.includes(g.filepath));if(c){let g=F[n]?.[c.fileType];g&&(e[n]={value:t,origin:{filepath:c.filepath,fileType:c.fileType,propertyPath:g},alternateOrigins:[]})}}}return{updated:i,failed:o,skipped:a}};var X=async(e,n,t)=>await J(e,"version",n,{...t,targetFiles:"all"});var w=class extends Error{constructor(n){super(n),this.name="WorkspaceError"}},U=async e=>{try{return await P({baseDir:e})}catch(n){throw n instanceof m?new w(`No package config file found in ${p.path.resolve(e)}`):n}},Z=async(e,n)=>{let t=[];for(let r of n)if(r.endsWith("/*")){let i=p.path.join(e,r.slice(0,-2));try{for await(let o of p.fs.readDir(i))o.isDirectory&&t.push(p.path.join(i,o.name))}catch{}}else if(r.includes("*")||r.includes("?")){let i=r.split("/"),o=[],a=0;for(let f=0;f<i.length;f++){if(i[f].includes("*")||i[f].includes("?")){a=f;break}o.push(i[f])}let l=p.path.join(e,...o),c=i.slice(a).join("/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]"),g=new RegExp(`^${c}$`);try{for await(let f of p.fs.walk(l,{includeDirs:!0,includeFiles:!1})){let C=p.path.relative(l,f.path);C!==""&&g.test(C)&&t.push(f.path)}}catch{}}else t.push(p.path.join(e,r));return t},ee=async e=>{let n=await U(e),t=n.workspaces?.value;if(!Array.isArray(t))throw new w("Package config doesn't have workspace field.");for(let o of t)if(typeof o!="string")throw new w("Package config workspace field should be an array of strings.");let r=await Z(e,t),i=[];for(let o of r){let a=await v({baseDir:o});if(a===void 0)continue;let l=a.name?.value,s=a.version?.value,c=a.private?.value;l!==void 0&&c!==!0&&i.push({name:l,version:s??"0.0.0",config:a})}return[n,i]};export{y as a,P as b,v as c,L as d,X as e,ee as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as b,b as w,d as F,f as D}from"./chunk-
|
|
2
|
+
import{a as b,b as w,d as F,f as D}from"./chunk-DYRTLYTU.js";import{a as C}from"./chunk-2VEVVX6U.js";import{a as h}from"./chunk-4DOMGQOO.js";import{f as R}from"./chunk-3BEX5FYF.js";import{b as l,f as m,g as k,h as A,i as g}from"./chunk-3SXTMY75.js";import{g as d}from"./chunk-A6RDYP6R.js";var x=(e,r)=>{let o={},t=e.length;for(let s=0;s<t;s++){let n=e[s],a=r(n);o[a]===void 0?o[a]=[n]:o[a].push(n)}return o};var u=h(),P=(e,r)=>e===r?!0:typeof e!=typeof r||typeof e!="object"||e===null||r===null?!1:JSON.stringify(e)===JSON.stringify(r),O=(e,r)=>e[r],j=e=>e.startsWith("npm:@jsr/"),B=e=>{let r=e.slice(9),o=r.indexOf("__");if(o===-1)throw new Error(`Invalid npm JSR format: ${e}`);let t=r.slice(0,o),s=r.slice(o+2),n=s.indexOf("@"),a,p;return n===-1?(a=s,p=""):(a=s.slice(0,n),p=s.slice(n)),`jsr:@${t}/${a}${p}`},_=(e,r)=>j(r)?B(r):r.startsWith("npm:")?r:`npm:${e}@${r}`,S=e=>e==="workspace:*"||e.startsWith("workspace:"),M=(e,r,o)=>{let t=[],s=r.dependencies??{},n=r.devDependencies??{},a={...s,...n},p=o.imports??{};for(let[y,c]of Object.entries(a)){if(S(c))continue;let f=_(y,c),i=p[y];i===void 0?t.push({packageName:e,dependencyName:y,issue:"missing_in_deno",expected:f}):i!==f&&t.push({packageName:e,dependencyName:y,issue:"version_mismatch",expected:f,actual:i})}for(let[y,c]of Object.entries(p))a[y]===void 0&&t.push({packageName:e,dependencyName:y,issue:"missing_in_package",actual:p[y]});return t},G=async(e,r)=>{let o=[],t=[],s=await w({baseDir:e,includeFiles:[b.DenoJson,b.PackageJson]}),n=s._loadedFiles.find(c=>c.fileType===b.DenoJson),a=s._loadedFiles.find(c=>c.fileType===b.PackageJson);if(n===void 0||a===void 0)return{inconsistencies:[],dependencyInconsistencies:[]};let p=["name","version","exports"];for(let c of p){let f=O(n.content,c),i=O(a.content,c);f===void 0||i===void 0||P(f,i)||o.push({packageName:r,field:c,denoValue:f,packageValue:i})}let y=M(r,a.content,n.content);return t.push(...y),{inconsistencies:o,dependencyInconsistencies:t}},K=async(e={})=>{let{root:r=".",failFast:o=!1}=e,[t,s]=await D(r),n=[],a=[],p=0;for(let c of s){let f=F(c.config);try{let i=await G(f,c.name);if(p++,i.inconsistencies.length>0&&n.push(...i.inconsistencies),i.dependencyInconsistencies.length>0&&a.push(...i.dependencyInconsistencies),o&&(i.inconsistencies.length>0||i.dependencyInconsistencies.length>0))return{isConsistent:!1,inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}}catch{continue}}return{isConsistent:!(n.length>0||a.length>0),inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}},v=e=>typeof e=="string"?`"${e}"`:JSON.stringify(e,null,2),H=e=>{switch(e.issue){case"missing_in_deno":return`Missing in deno.json imports. Expected: ${e.expected}`;case"missing_in_package":return`Extra in deno.json imports (not in package.json): ${e.actual}`;case"version_mismatch":return`Version mismatch. Expected: ${e.expected}, Actual: ${e.actual}`}},L=e=>R.fromPromise(()=>K(e)),$=e=>d.ok({root:"."}),N=e=>{if(d.isFail(e))return u.writeln(m("\u2717"),l(" "+String(e.error))),d.fail({exitCode:1});let{value:r}=e;if(u.writeln(g("\u2139"),l(` Checked ${r.packagesChecked} packages.`)),!r.isConsistent){if(r.inconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.inconsistencies.length} field inconsistencies:`));let o=x(r.inconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.field} mismatch:`)),u.writeln(g("\u2139"),l(` deno.json: ${v(n.denoValue)}`)),u.writeln(g("\u2139"),l(` package.json: ${v(n.packageValue)}`))}}if(r.dependencyInconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.dependencyInconsistencies.length} dependency inconsistencies:`));let o=x(r.dependencyInconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.dependencyName}:`)),u.writeln(g("\u2139"),l(` ${H(n)}`))}}return d.fail({exitCode:1})}return u.writeln(k("\u2713"),l(" All package configs are consistent.")),d.ok(void 0)},J=C.createTrigger({handler:L,adaptInput:$,adaptOutput:N}),qn=async e=>await J({command:"validate-package-configs",args:[],flags:{}});export{K as a,L as b,J as c,qn as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as E}from"./chunk-
|
|
2
|
+
import{a as E}from"./chunk-KBFKBL6A.js";import{a as y}from"./chunk-2VEVVX6U.js";import{a as C}from"./chunk-4DOMGQOO.js";import{f as v}from"./chunk-3BEX5FYF.js";import{b as i,f as m,g as x,h as k,i as g}from"./chunk-3SXTMY75.js";import{g as p}from"./chunk-A6RDYP6R.js";import{v as h}from"./chunk-MRCBHVSB.js";var l=C(),d=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase(),f=(e,o=[])=>{let s=e.split("/").filter(r=>r.length>0);for(let r of s){let t=r.startsWith(".")?r.slice(1):r;if(t.length===0)continue;let a=h.runtime.path.extname(t);if(a.length>0&&(t=t.slice(0,-a.length)),t.length!==0&&!o.includes(t)&&!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(t))return!1}return!0},N=async(e={})=>{let{root:o=".",ignoreWords:s=[]}=e,r=await E(o),t=[];for(let a of r){let n=a.config.exports?.value;if(n!=null){if(typeof n=="string"){f(n,s)||t.push({packageName:a.name,exportPath:n,suggestion:d(n)});continue}if(n!==null&&typeof n=="object")for(let[u,c]of Object.entries(n))f(u,s)||t.push({packageName:a.name,exportPath:u,suggestion:d(u)}),typeof c=="string"&&!f(c,s)&&t.push({packageName:a.name,exportPath:c,suggestion:d(c)})}}return{isValid:t.length===0,violations:t,packagesChecked:r.length}},w=e=>v.fromPromise(()=>N(e)),b=e=>p.ok({root:"."}),A=e=>{if(p.isFail(e))return l.writeln(m("\u2717"),i(" "+String(e.error))),p.fail({exitCode:1});let{value:o}=e;if(l.writeln(g("\u2139"),i(` Checked ${o.packagesChecked} packages.`)),!o.isValid){l.writeln(m("\u2717"),i(` Found ${o.violations.length} naming violations:`));for(let s of o.violations)l.writeln(k("\u26A0"),i(" "+s.packageName)),l.writeln(g("\u2139"),i(` Export: ${s.exportPath}`)),l.writeln(g("\u2139"),i(` Suggestion: ${s.suggestion}`));return p.fail({exitCode:1})}return l.writeln(x("\u2713"),i(" All export names follow conventions.")),p.ok(void 0)},P=y.createTrigger({handler:w,adaptInput:b,adaptOutput:A}),W=async e=>await P({command:"validate-export-names",args:[],flags:{}});export{N as a,w as b,P as c,W as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as w}from"./chunk-
|
|
2
|
+
import{a as w}from"./chunk-KBFKBL6A.js";import{a as v}from"./chunk-2VEVVX6U.js";import{a as y}from"./chunk-4DOMGQOO.js";import{f as k}from"./chunk-3BEX5FYF.js";import{b as l,f,g as h,h as C,i as m}from"./chunk-3SXTMY75.js";import{g as a}from"./chunk-A6RDYP6R.js";var p=y(),D=e=>{let s=new Map,r=new Set(e.map(i=>i.name));for(let i of e){let n=[];for(let d of i.config._loadedFiles){let t=d.content,u=t.dependencies;if(u!==void 0)for(let c of Object.keys(u))r.has(c)&&n.push(c);let o=t.imports;if(o!==void 0)for(let c of Object.values(o))r.has(c)&&n.push(c)}s.set(i.name,[...new Set(n)])}return s},x=e=>{let s=[],r=new Set,i=new Set,n=[],d=t=>{r.add(t),i.add(t),n.push(t);let u=e.get(t)??[];for(let o of u)if(!r.has(o))d(o);else if(i.has(o)){let c=n.indexOf(o),g=n.slice(c);g.push(o),s.push(g)}n.pop(),i.delete(t)};for(let t of e.keys())r.has(t)||d(t);return s},R=async(e={})=>{let{root:s="."}=e,r=await w(s),i=D(r),n=x(i);return{hasCycles:n.length>0,cycles:n,packagesChecked:r.length}},O=e=>k.fromPromise(()=>R(e)),b=e=>a.ok({root:"."}),A=e=>{if(a.isFail(e))return p.writeln(f("\u2717"),l(" "+(e.error instanceof Error?e.error.message:String(e.error)))),a.fail({exitCode:1});let{value:s}=e;if(p.writeln(m("\u2139"),l(` Checked ${s.packagesChecked} packages.`)),s.hasCycles){p.writeln(f("\u2717"),l(` Found ${s.cycles.length} circular dependencies:`));for(let r of s.cycles)p.writeln(C("\u26A0"),l(` ${r.join(" \u2192 ")}`));return a.fail({exitCode:1})}return p.writeln(h("\u2713"),l(" No circular dependencies found.")),a.ok(void 0)},M=v.createTrigger({handler:O,adaptInput:b,adaptOutput:A}),_=async e=>await M({command:"validate-circular-deps",args:[],flags:{}});export{R as a,O as b,M as c,_ as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as a,f as g}from"./chunk-
|
|
2
|
+
import{d as a,f as g}from"./chunk-DYRTLYTU.js";import{b as i}from"./chunk-NBA6EFWU.js";import{t as s}from"./chunk-MRCBHVSB.js";var u=async(n=".")=>{let[t,r]=await g(n);return r.map(e=>({name:e.name,version:e.version,path:a(e.config),config:e.config,entrypoints:c(e.config)}))},c=n=>{let t=n.exports?.value;if(t==null)return[];if(typeof t=="string")return[t];if(t!==null&&typeof t=="object"){let r=[];for(let e of Object.values(t))typeof e=="string"&&r.push(e);return r}return[]},d=(n,t)=>s.path.isAbsolute(n)?n:s.path.resolve(t,n),k=async n=>{let t=[];for await(let r of s.fs.walk(n,{exts:i,includeDirs:!1,skip:[/node_modules/,/\.git/]})){let e=s.path.relative(n,r.path),o=s.path.basename(e);o.endsWith("_test.ts")||o.endsWith("_bench.ts")||o.startsWith("_")||e.includes("testdata/")||t.push(`./${e}`)}return t.sort()};export{u as a,d as b,k as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as r}from"./chunk-
|
|
2
|
+
import{b as r}from"./chunk-PZNCE6QK.js";var n=class{description;#o;#s;#e=[];constructor(o){this.description=o.description,this.#o=o.modules??{},this.#s=o.aliases??{}}addSubmodule(o,e){return this.#e.push({registration:o,module:e}),this}async addSubmoduleAsync(o,e){let s=await e;return this.#e.push({registration:o,module:s}),this}toGroupOptions(){return{description:this.description,modules:this.#o,aliases:Object.keys(this.#s).length>0?this.#s:void 0}}toCommand(o,e){let s=new r(o).description(this.description);e!==void 0&&s.version(e),Object.keys(this.#o).length>0&&s.modules(this.toGroupOptions());for(let{registration:t,module:d}of this.#e){let i=d.toGroupOptions();if(s.group(t.name,i),t.aliases!==void 0)for(let a of t.aliases)s.groupAlias(a,t.name,i)}return s}};export{n as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
var s={id:"open-source",name:"Open Source",description:"Community-driven, inclusive, well-documented. Prioritize contributor experience, avoid exclusionary patterns, default to permissive choices.",extras:[{questionId:"status_quo",text:"Is this workaround common in the community?"},{questionId:"user_impact",text:"Does this make contribution harder?"}],specSections:["Contributor Guide","Public API Surface"],reminders:["Endpoint should be documented in API docs","Consider contributor experience for new patterns","Default to permissive, well-documented choices"],acceptanceCriteria:["Public API documented","Changes reflected in README or API docs","No exclusionary patterns introduced"]};var r={id:"beautiful-product",name:"Beautiful Product",description:"Design and UX are first-class. Agent critiques UI/UX like a passionate designer. Empty states, error states, loading states, mobile layout \u2014 nothing ships unspecified.",extras:[{questionId:"status_quo",text:"How painful is the current experience?"},{questionId:"ambition",text:"In the 10-star version, what does the user feel?"}],specSections:["Design States (empty, loading, error, success)","Mobile Layout","Interaction Design"],reminders:["Loading state and error state must be designed, not placeholder","No AI slop \u2014 every UI element is intentional","Empty states need clear CTAs with examples"],acceptanceCriteria:["All UI states designed (empty, loading, error, success)","Mobile layout considered","No placeholder or skeleton UI left unfinished"]};var a={id:"long-lived",name:"Long-Lived",description:"Built to last. Stability, maintainability, and backward compatibility matter. Every shortcut needs justification. Favor boring technology.",extras:[{questionId:"reversibility",text:"Will this decision still be correct in 2 years?"},{questionId:"scope_boundary",text:"What technical debt would this introduce?"}],specSections:["Migration & Deprecation","Backward Compatibility"],reminders:["Favor boring technology over shiny new tools","Every shortcut needs explicit justification","Consider maintenance burden for new dependencies"],acceptanceCriteria:["Backward compatibility preserved","Migration path documented if breaking","No unnecessary new dependencies"]};var c={id:"move-fast",name:"Move Fast",description:"Optimize for shipping speed. Acceptable trade-offs on polish. Good enough is good enough. Reduce ceremony.",extras:[{questionId:"scope_boundary",text:"Which polish items can be deferred to v2?"},{questionId:"ambition",text:"What is the minimum viable 5-star version?"}],specSections:["v1 vs v2 Scope"],reminders:["Good enough is good enough \u2014 ship it","Reduce ceremony, optimize for feedback speed","Mark polish items for v2 explicitly"],acceptanceCriteria:["Core functionality works","v2 items explicitly deferred"]};var d={id:"compliance",name:"Compliance",description:"Audit trails, access controls, data handling rules. Every change is traceable. Verification is mandatory, not optional.",extras:[{questionId:"reversibility",text:"Is the audit trail preserved on rollback?"},{questionId:"verification",text:"Is there an audit/traceability requirement?"}],specSections:["Audit Trail","Access Control","Data Handling"],reminders:["Every state change must be traceable","Verification is mandatory, not optional","Document data handling and retention policies"],acceptanceCriteria:["Audit trail added for state changes","Access control verified","Data handling documented"]};var l={id:"learning-project",name:"Learning Project",description:"Experimentation is the goal. Encourage trying new patterns, don't punish dead ends. Document learnings over polish.",extras:[{questionId:"ambition",text:"What do you want to learn from building this?"},{questionId:"scope_boundary",text:"What experiments are explicitly allowed?"}],specSections:["Learning Goals","Experiment Log"],reminders:["Document learnings, not just outcomes","Dead ends are acceptable \u2014 document why","Try new patterns freely, polish later"],acceptanceCriteria:["Learnings documented","Experiment outcomes recorded"]};var u=[s,r,a,c,d,l];var N=()=>Promise.resolve(u),U=(t,n)=>{let e=[];for(let i of t)for(let o of i.extras)o.questionId===n&&e.push(o);return e},F=t=>{let n=[];for(let e of t)for(let i of e.reminders)n.push(`${e.id}: ${i}`);return n},_=t=>{let n=[],e=t.map(i=>i.id);return e.includes("move-fast")&&e.includes("compliance")&&n.push({between:["move-fast","compliance"],issue:"Speed vs traceability \u2014 shortcuts may violate audit requirements."}),e.includes("move-fast")&&e.includes("long-lived")&&n.push({between:["move-fast","long-lived"],issue:"Shipping speed vs maintainability \u2014 tech debt decisions need human approval."}),e.includes("beautiful-product")&&e.includes("move-fast")&&n.push({between:["beautiful-product","move-fast"],issue:"Design polish vs speed \u2014 which UI states can be deferred?"}),n};export{
|
|
2
|
+
var s={id:"open-source",name:"Open Source",description:"Community-driven, inclusive, well-documented. Prioritize contributor experience, avoid exclusionary patterns, default to permissive choices.",extras:[{questionId:"status_quo",text:"Is this workaround common in the community?"},{questionId:"user_impact",text:"Does this make contribution harder?"}],specSections:["Contributor Guide","Public API Surface"],reminders:["Endpoint should be documented in API docs","Consider contributor experience for new patterns","Default to permissive, well-documented choices"],acceptanceCriteria:["Public API documented","Changes reflected in README or API docs","No exclusionary patterns introduced"]};var r={id:"beautiful-product",name:"Beautiful Product",description:"Design and UX are first-class. Agent critiques UI/UX like a passionate designer. Empty states, error states, loading states, mobile layout \u2014 nothing ships unspecified.",extras:[{questionId:"status_quo",text:"How painful is the current experience?"},{questionId:"ambition",text:"In the 10-star version, what does the user feel?"}],specSections:["Design States (empty, loading, error, success)","Mobile Layout","Interaction Design"],reminders:["Loading state and error state must be designed, not placeholder","No AI slop \u2014 every UI element is intentional","Empty states need clear CTAs with examples"],acceptanceCriteria:["All UI states designed (empty, loading, error, success)","Mobile layout considered","No placeholder or skeleton UI left unfinished"]};var a={id:"long-lived",name:"Long-Lived",description:"Built to last. Stability, maintainability, and backward compatibility matter. Every shortcut needs justification. Favor boring technology.",extras:[{questionId:"reversibility",text:"Will this decision still be correct in 2 years?"},{questionId:"scope_boundary",text:"What technical debt would this introduce?"}],specSections:["Migration & Deprecation","Backward Compatibility"],reminders:["Favor boring technology over shiny new tools","Every shortcut needs explicit justification","Consider maintenance burden for new dependencies"],acceptanceCriteria:["Backward compatibility preserved","Migration path documented if breaking","No unnecessary new dependencies"]};var c={id:"move-fast",name:"Move Fast",description:"Optimize for shipping speed. Acceptable trade-offs on polish. Good enough is good enough. Reduce ceremony.",extras:[{questionId:"scope_boundary",text:"Which polish items can be deferred to v2?"},{questionId:"ambition",text:"What is the minimum viable 5-star version?"}],specSections:["v1 vs v2 Scope"],reminders:["Good enough is good enough \u2014 ship it","Reduce ceremony, optimize for feedback speed","Mark polish items for v2 explicitly"],acceptanceCriteria:["Core functionality works","v2 items explicitly deferred"]};var d={id:"compliance",name:"Compliance",description:"Audit trails, access controls, data handling rules. Every change is traceable. Verification is mandatory, not optional.",extras:[{questionId:"reversibility",text:"Is the audit trail preserved on rollback?"},{questionId:"verification",text:"Is there an audit/traceability requirement?"}],specSections:["Audit Trail","Access Control","Data Handling"],reminders:["Every state change must be traceable","Verification is mandatory, not optional","Document data handling and retention policies"],acceptanceCriteria:["Audit trail added for state changes","Access control verified","Data handling documented"]};var l={id:"learning-project",name:"Learning Project",description:"Experimentation is the goal. Encourage trying new patterns, don't punish dead ends. Document learnings over polish.",extras:[{questionId:"ambition",text:"What do you want to learn from building this?"},{questionId:"scope_boundary",text:"What experiments are explicitly allowed?"}],specSections:["Learning Goals","Experiment Log"],reminders:["Document learnings, not just outcomes","Dead ends are acceptable \u2014 document why","Try new patterns freely, polish later"],acceptanceCriteria:["Learnings documented","Experiment outcomes recorded"]};var u=[s,r,a,c,d,l];var N=()=>Promise.resolve(u),U=(t,n)=>{let e=[];for(let i of t)for(let o of i.extras)o.questionId===n&&e.push(o);return e},F=t=>{let n=[];for(let e of t)for(let i of e.reminders)n.push(`${e.id}: ${i}`);return n},_=t=>{let n=[],e=t.map(i=>i.id);return e.includes("move-fast")&&e.includes("compliance")&&n.push({between:["move-fast","compliance"],issue:"Speed vs traceability \u2014 shortcuts may violate audit requirements."}),e.includes("move-fast")&&e.includes("long-lived")&&n.push({between:["move-fast","long-lived"],issue:"Shipping speed vs maintainability \u2014 tech debt decisions need human approval."}),e.includes("beautiful-product")&&e.includes("move-fast")&&n.push({between:["beautiful-product","move-fast"],issue:"Design polish vs speed \u2014 which UI states can be deferred?"}),n};export{u as a,N as b,U as c,F as d,_ as e};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as _,b as H,c as P}from"./chunk-5GGGQJ4P.js";import{e as Q}from"./chunk-J2Z7NG2X.js";import{f as p,h as u,k as c}from"./chunk-GBM3TZFD.js";import{b as r,d as l,f as m,g,h as Y,k as o}from"./chunk-3SXTMY75.js";import{d as x}from"./chunk-PVPMHMKP.js";import{a as v}from"./chunk-
|
|
2
|
+
import{a as _,b as H,c as P}from"./chunk-5GGGQJ4P.js";import{e as Q}from"./chunk-J2Z7NG2X.js";import{f as p,h as u,k as c}from"./chunk-GBM3TZFD.js";import{b as r,d as l,f as m,g,h as Y,k as o}from"./chunk-3SXTMY75.js";import{d as x}from"./chunk-PVPMHMKP.js";import{a as v}from"./chunk-QSION3QA.js";import{a as h,b as w}from"./chunk-A6RDYP6R.js";import{a as re,g as W,h as K,i as B,r as I,t as d}from"./chunk-MRCBHVSB.js";var oe="# eser CLI completions",D="eser",X=async e=>{try{return await d.fs.readTextFile(e)}catch{return""}},ie=async e=>{try{return await d.fs.stat(e),!0}catch{return!1}},Z=async e=>{let t=P(e,D);if(t.completionType==="file")return await ie(t.completionsFile);let s=await X(t.rcFile),n=H(e,D);return s.includes(n)},ee=async e=>{let t=P(e,D),s=p({renderer:c.ansi(),sink:u.stdout()});try{if(t.completionType==="file"){let n=t.completionsFile,a=d.path.dirname(n);try{await d.fs.mkdir(a,{recursive:!0})}catch{}await d.fs.writeTextFile(n,`# eser CLI completions
|
|
3
3
|
# This file is auto-generated. Run 'eser system completions --shell fish' to regenerate.
|
|
4
4
|
complete -c eser -f
|
|
5
5
|
complete -c eser -n "__fish_use_subcommand" -a "codebase" -d "Codebase management tools"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as u}from"./chunk-MG65QJY6.js";import{a as p,b as f}from"./chunk-A6RDYP6R.js";import{t as x}from"./chunk-MRCBHVSB.js";var h=t=>{let e=[],n=[],
|
|
3
|
-
`)};var w=t=>{let e=[];for(let n of t)e.push(`--${n.name}`),n.short!==void 0&&e.push(`-${n.short}`);return e.join(" ")},k=(t,e)=>{if(t.children===void 0||t.children.length===0)return"";let n=t.children.map(o=>o.name).join(" "),
|
|
4
|
-
`;
|
|
5
|
-
`,
|
|
6
|
-
`,
|
|
7
|
-
`;for(let o of t.children)o.children!==void 0&&o.children.length>0&&(
|
|
2
|
+
import{a as u}from"./chunk-MG65QJY6.js";import{a as p,b as f}from"./chunk-A6RDYP6R.js";import{t as x}from"./chunk-MRCBHVSB.js";var h=t=>{let e=[],n=[],i={},s={};for(let r of t)r.type==="boolean"?e.push(r.name):n.push(r.name),r.short!==void 0&&(i[r.short]=r.name),r.default!==void 0&&(s[r.name]=r.default);return{boolean:e,string:n,alias:i,default:s}},T=t=>t!=null&&t.constructor===String,V={boolean:t=>!!t,number:t=>T(t)?Number(t):t,string:t=>String(t),"string[]":t=>Array.isArray(t)?t.map(String):[String(t)]},v=(t,e)=>{if(t!==void 0)return V[e]?.(t)??t},$=(t,e)=>{let n={};for(let i of e){let s=t[i.name];n[i.name]=v(s,i.type)}return n},ie=(t,e)=>{let n=h(e),i=u(t,n);return{positional:i._,flags:$(i,e)}},_=(t,e)=>{let n=[];for(let i of e)if(i.required===!0){let s=t[i.name];(s===void 0||s===""||s===!1)&&n.push(`Required flag --${i.name} is missing`)}return n};var O=(t,e)=>t+" ".repeat(Math.max(0,e-t.length)),U=t=>{let e=t.short!==void 0?`-${t.short}, `:"",n=t.type!=="boolean"?` <${t.type}>`:"";return`${e}--${t.name}${n}`},q=(t,e)=>[t.description!==void 0?`${e} - ${t.description}`:e,""],B=(t,e)=>{if(t.usage!==void 0)return["Usage:",` ${t.usage}`,""];let n=t.children.length>0?" <command>":"",i=t.flags.length>0?" [options]":"";return["Usage:",` ${e}${n}${i}`,""]},I=t=>{if(t.length===0)return[];let e=s=>s.aliases!==void 0&&s.aliases.length>0?`${s.name}, ${s.aliases.join(", ")}`:s.name,n=Math.max(...t.map(s=>e(s).length));return["Commands:",...t.map(s=>` ${O(e(s),n+2)}${s.description??""}`),""]},Y=t=>{if(t.length===0)return[];let e=t.map(s=>({flag:U(s),desc:s.description})),n=Math.max(...e.map(s=>s.flag.length));return["Options:",...e.map(({flag:s,desc:r})=>` ${O(s,n+2)}${r}`),""]},Z=t=>t?.length?["Examples:",...t.map(e=>` ${e}`),""]:[],M=(t,e)=>{let n=e.join(" "),i=[...q(t,n),...B(t,n),...I(t.children),...Y(t.flags),...Z(t.examples)];return t.children.length>0&&i.push(`Run '${n} <command> --help' for more information on a command.`),i.join(`
|
|
3
|
+
`)};var w=t=>{let e=[];for(let n of t)e.push(`--${n.name}`),n.short!==void 0&&e.push(`-${n.short}`);return e.join(" ")},k=(t,e)=>{if(t.children===void 0||t.children.length===0)return"";let n=t.children.map(o=>o.name).join(" "),i=t.flags!==void 0?w(t.flags):"",s=[n,i].filter(o=>o.length>0).join(" "),r=` ${e})
|
|
4
|
+
`;r+=` COMPREPLY=( $(compgen -W "${s}" -- "\${cur}") )
|
|
5
|
+
`,r+=` return 0
|
|
6
|
+
`,r+=` ;;
|
|
7
|
+
`;for(let o of t.children)o.children!==void 0&&o.children.length>0&&(r+=k(o,`${e} ${o.name}`));return r},D=(t,e)=>{let n=e.children?.map(o=>o.name).join(" ")??"",i=e.flags!==void 0?w(e.flags):"",s=[n,i].filter(o=>o.length>0).join(" "),r="";if(e.children!==void 0)for(let o of e.children)r+=k(o,o.name);return`# ${t} bash completion
|
|
8
8
|
# Generated by @eser/shell/completions
|
|
9
9
|
|
|
10
10
|
_${t}_completions() {
|
|
@@ -34,7 +34,7 @@ _${t}_completions() {
|
|
|
34
34
|
done
|
|
35
35
|
|
|
36
36
|
case "$cmd_path" in
|
|
37
|
-
${
|
|
37
|
+
${r} "")
|
|
38
38
|
COMPREPLY=( $(compgen -W "${s}" -- "\${cur}") )
|
|
39
39
|
return 0
|
|
40
40
|
;;
|
|
@@ -42,13 +42,13 @@ ${i} "")
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
complete -F _${t}_completions ${t}
|
|
45
|
-
`};var R=t=>t.replace(/'/g,"'\\''"),K=t=>{let e=[];for(let n of t){let
|
|
45
|
+
`};var R=t=>t.replace(/'/g,"'\\''"),K=t=>{let e=[];for(let n of t){let i=R(n.description??`${n.name} flag`);n.takesValue===!0?(e.push(`'--${n.name}=[${i}]'`),n.short!==void 0&&e.push(`'-${n.short}=[${i}]'`)):(e.push(`'--${n.name}[${i}]'`),n.short!==void 0&&e.push(`'-${n.short}[${i}]'`))}return e},Q=t=>t.map(n=>{let i=R(n.description??n.name);return`'${n.name}:${i}'`}).join(`
|
|
46
46
|
`),P=(t,e,n)=>{let s=`${n.length===0?`_${t}`:`_${t}_${n.join("_")}`}() {
|
|
47
47
|
`;if(s+=` local -a commands
|
|
48
48
|
`,s+=` local -a flags
|
|
49
49
|
|
|
50
|
-
`,e.flags!==void 0&&e.flags.length>0){let
|
|
51
|
-
${
|
|
50
|
+
`,e.flags!==void 0&&e.flags.length>0){let r=K(e.flags);s+=` flags=(
|
|
51
|
+
${r.join(`
|
|
52
52
|
`)}
|
|
53
53
|
)
|
|
54
54
|
|
|
@@ -65,7 +65,7 @@ complete -F _${t}_completions ${t}
|
|
|
65
65
|
`,s+=` _describe -t commands 'command' commands
|
|
66
66
|
`,s+=` ;;
|
|
67
67
|
`,s+=` args)
|
|
68
|
-
`,s+=' case "${words[1]}" in\n';for(let
|
|
68
|
+
`,s+=' case "${words[1]}" in\n';for(let r of e.children){let o=[...n,r.name],a=`_${t}_${o.join("_")}`;s+=` ${r.name})
|
|
69
69
|
`,s+=` ${a}
|
|
70
70
|
`,s+=` ;;
|
|
71
71
|
`}s+=` esac
|
|
@@ -73,20 +73,20 @@ complete -F _${t}_completions ${t}
|
|
|
73
73
|
`,s+=` esac
|
|
74
74
|
`}else e.flags!==void 0&&e.flags.length>0&&(s+=' _arguments "${flags[@]}"\n');if(s+=`}
|
|
75
75
|
|
|
76
|
-
`,e.children!==void 0)for(let
|
|
76
|
+
`,e.children!==void 0)for(let r of e.children)s+=P(t,r,[...n,r.name]);return s},H=(t,e)=>{let n=`#compdef ${t}
|
|
77
77
|
`;return n+=`# ${t} zsh completion
|
|
78
78
|
`,n+=`# Generated by @eser/shell/completions
|
|
79
79
|
|
|
80
|
-
`,n+=P(t,e,[]),n};var S=t=>t.replace(
|
|
81
|
-
`}return
|
|
82
|
-
`;else{let a=`-n "__fish_seen_subcommand_from ${n[n.length-1]}"`;
|
|
83
|
-
`}}for(let
|
|
80
|
+
`,n+=P(t,e,[]),n};var S=t=>t.replace(/[\\'\$`()]/g,"\\$&"),ee=(t,e,n)=>{let i="";for(let s of e){let r=S(s.description??`${s.name} flag`),o=`complete -c ${t} ${n}`;o+=` -l ${s.name}`,s.short!==void 0&&(o+=` -s ${s.short}`),s.takesValue===!0&&(o+=" -r"),o+=` -d '${r}'`,i+=o+`
|
|
81
|
+
`}return i},A=(t,e,n)=>{let i="",s;if(n.length===0?s="-n __fish_use_subcommand":s=`-n "${n.map(o=>`__fish_seen_subcommand_from ${o}`).join("; and ")}"`,e.children!==void 0&&e.children.length>0){for(let r of e.children){let o=S(r.description??r.name);if(n.length===0)i+=`complete -c ${t} -f ${s} `,i+=`-a "${r.name}" -d '${o}'
|
|
82
|
+
`;else{let a=`-n "__fish_seen_subcommand_from ${n[n.length-1]}"`;i+=`complete -c ${t} -f ${a} `,i+=`-a "${r.name}" -d '${o}'
|
|
83
|
+
`}}for(let r of e.children)i+=A(t,r,[...n,r.name])}return e.flags!==void 0&&e.flags.length>0&&(i+=ee(t,e.flags,s)),i},j=(t,e)=>{let n=`# ${t} fish completion
|
|
84
84
|
`;return n+=`# Generated by @eser/shell/completions
|
|
85
85
|
|
|
86
86
|
`,n+=`complete -c ${t} -f
|
|
87
87
|
|
|
88
|
-
`,n+=A(t,e,[]),n};var E=(t,e,n)=>{switch(t){case"bash":return D(e,n);case"zsh":return H(e,n);case"fish":return j(e,n)}};var N=class t{#e;#a;#c;#g=[];#l=[];#$=[];#m=[];#o=[];#s=new Map;#
|
|
89
|
-
`),this.#b(g,l),f({exitCode:1})):await(await b.load()).main(d.slice(2))}if(this.#f!==void 0)return await this.#f(c,d.slice(1))}if(this.#u===void 0)return console.log(this.help()),p(void 0);let C=_(a,
|
|
88
|
+
`,n+=A(t,e,[]),n};var E=(t,e,n)=>{switch(t){case"bash":return D(e,n);case"zsh":return H(e,n);case"fish":return j(e,n)}};var N=class t{#e;#a;#c;#g=[];#l=[];#$=[];#m=[];#o=[];#s=new Map;#i=new Map;#p=new Map;#n;#f;#u;#r={validation:"none"};#h;#t;constructor(e){this.#e=e}get name(){return this.#e}description(e){return this.#a=e,this}usage(e){return this.#c=e,this}example(e){return this.#g.push(e),this}aliases(...e){return this.#l=e,this}version(e){return this.#h=e,this}flag(e){return this.#$.push(e),this}persistentFlag(e){return this.#m.push({...e,persistent:!0}),this}args(e,n){return e==="exact"&&typeof n=="number"?this.#r={validation:e,count:n}:e==="min"&&typeof n=="number"?this.#r={validation:e,min:n}:e==="max"&&typeof n=="number"?this.#r={validation:e,max:n}:e==="range"&&Array.isArray(n)?this.#r={validation:e,min:n[0],max:n[1]}:this.#r={validation:e},this}command(e){return e.#t=this,this.#o.push(e),this}commands(...e){for(let n of e)this.command(n);return this}run(e){return this.#u=e,this}lazyCommand(e,n){return this.#s.set(e,n),this}group(e,n){return this.#i.set(e,n),this}groupAlias(e,n,i){return this.#i.set(e,i),this.#p.set(e,n),this}modules(e){return this.#n=e,this}fallback(e){return this.#f=e,this}static#x=[{name:"help",short:"h",type:"boolean",description:"Show help for this command"}];#d(){let e=[],n=this.#t;for(;n!==void 0;)e.push(...n.#m),n=n.#t;return[...t.#x,...e,...this.#m,...this.#$]}#C(){return this.#t===void 0?this:this.#t.#C()}#y(){return this.#t===void 0?[this.#e]:[...this.#t.#y(),this.#e]}#_(e){return this.#o.find(n=>n.#e===e||n.#l.includes(e))}#O(e){let{validation:n,count:i,min:s,max:r}=this.#r,o=e.length;switch(n){case"no-args":if(o>0)return"This command takes no arguments";break;case"exact":if(o!==i)return`Expected exactly ${i} argument(s), got ${o}`;break;case"min":if(o<(s??0))return`Expected at least ${s} argument(s), got ${o}`;break;case"max":if(o>(r??1/0))return`Expected at most ${r} argument(s), got ${o}`;break;case"range":if(o<(s??0)||o>(r??1/0))return`Expected ${s}-${r} arguments, got ${o}`;break}}async parse(e){let n=e??x.process.args;return await this.#F(n,[])}async#F(e,n){let i=this.#d(),s=h(i),r=this.#o.length>0||this.#s.size>0||this.#i.size>0||this.#n!==void 0,o=u(e,{...s,stopEarly:r}),a=$(o,i),d=o._;if(this.#h!==void 0&&a.version===!0)return console.log(`${this.#e} ${this.#h}`),p(void 0);if(a.help===!0)return console.log(this.help()),p(void 0);let c=d[0];if(c!==void 0&&r){let F=this.#_(c);if(F!==void 0)return await F.#F(d.slice(1),[...n,this.#e]);if(this.#s.has(c)){let l=await this.#s.get(c).load();return l instanceof t?(l.#t=this,await l.parse(d.slice(1))):"parse"in l&&typeof l.parse=="function"?await l.parse(d.slice(1)):(console.log(l.help()),p(void 0))}if(this.#n!==void 0){let g=this.#n.aliases?.[c]??c,l=this.#n.modules[g];if(l!==void 0)return await(await l.load()).main(d.slice(1))}for(let[g,l]of this.#i)if(c===g){let m=d[1];if(m===void 0||m==="--help"||m==="-h")return this.#b(g,l),p(void 0);let G=l.aliases?.[m]??m,b=l.modules[G];return b===void 0?(console.error(`Unknown module: ${g} ${m}
|
|
89
|
+
`),this.#b(g,l),f({exitCode:1})):await(await b.load()).main(d.slice(2))}if(this.#f!==void 0)return await this.#f(c,d.slice(1))}if(this.#u===void 0)return console.log(this.help()),p(void 0);let C=_(a,i);if(C.length>0)return f({message:C.join(`
|
|
90
90
|
`),exitCode:1});let y=this.#O(d);if(y!==void 0)return f({message:y,exitCode:1});let L=[...n,this.#e],z={args:d,flags:a,root:this.#C(),commandPath:L};return await this.#u(z)}#b(e,n){console.log(`${this.#e} ${e} - ${n.description}
|
|
91
91
|
`),console.log(`Usage: ${this.#e} ${e} <module> [options]
|
|
92
|
-
`);let
|
|
92
|
+
`);let i=new Map;for(let[s,r]of Object.entries(n.modules)){let o=r.category??"Modules",a=i.get(o)??[];a.push([s,r]),i.set(o,a)}for(let[s,r]of i){console.log(`${s}:`);for(let[o,a]of r)console.log(` ${o.padEnd(24)} ${a.description}`);console.log()}if(n.aliases!==void 0&&Object.keys(n.aliases).length>0){console.log("Aliases:");for(let[s,r]of Object.entries(n.aliases))console.log(` ${s.padEnd(24)} \u2192 ${r}`)}}help(){let e=[...this.#o.map(i=>({name:i.#e,aliases:i.#l.length>0?i.#l:void 0,description:i.#a,usage:i.#c,examples:i.#g,flags:i.#d(),children:[]})),...[...this.#s.entries()].map(([i,s])=>({name:i,description:s.description,flags:[],children:[]})),...this.#n!==void 0?Object.entries(this.#n.modules).map(([i,s])=>({name:i,description:s.description,flags:s.flags??[],children:[]})):[],...[...this.#i.entries()].filter(([i])=>!this.#p.has(i)).map(([i,s])=>{let r=[...this.#p.entries()].filter(([o,a])=>a===i).map(([o])=>o);return{name:i,aliases:r.length>0?r:void 0,description:s.description,flags:[],children:[]}})],n={name:this.#e,description:this.#a,usage:this.#c,examples:this.#g,flags:this.#d(),children:e};return M(n,this.#y())}#M(){let e=i=>i.map(s=>({name:s.name,short:s.short,description:s.description,takesValue:s.type!=="boolean"})),n=i=>{let s=i.#o.map(n);for(let[r,o]of i.#s)s.push({name:r,description:o.description,children:[],flags:[]});if(i.#n!==void 0)for(let[r,o]of Object.entries(i.#n.modules))s.push({name:r,description:o.description,children:[],flags:o.flags!==void 0?e(o.flags):[]});for(let[r,o]of i.#i){let a=Object.entries(o.modules).map(([d,c])=>({name:d,description:c.description,children:[],flags:c.flags!==void 0?e(c.flags):[]}));s.push({name:r,description:o.description,children:a,flags:[]})}return{name:i.#e,description:i.#a,children:s,flags:e(i.#d())}};return n(this)}completions(e){let n=this.#M();return E(e,this.#e,n)}};export{ie as a,N as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
var r={name:"@eser/cli",version:"4.1.
|
|
2
|
+
var r={name:"@eser/cli",version:"4.1.36",type:"module",exports:"./main.ts",bin:{eser:"./bin.ts"},dependencies:{"@eser/ai":"workspace:*","@eser/codebase":"workspace:*","@eser/kit":"workspace:*","@eser/noskills":"workspace:*","@eser/laroux-server":"workspace:*","@eser/workflows":"workspace:*","@eser/functions":"workspace:*","@eser/logging":"workspace:*","@eser/shell":"workspace:*","@eser/standards":"workspace:*","@std/cli":"npm:@jsr/std__cli@^1.0.25","@std/fmt":"npm:@jsr/std__fmt@^1.0.8"},devDependencies:{"@std/assert":"npm:@jsr/std__assert@^1.0.16",esbuild:"^0.27.3"}};export{r as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as E,b as A,c as I}from"./chunk-
|
|
2
|
+
import{a as E,b as A,c as I}from"./chunk-KBFKBL6A.js";import{a as w}from"./chunk-2VEVVX6U.js";import{a as v}from"./chunk-4DOMGQOO.js";import{f as D}from"./chunk-3BEX5FYF.js";import{b as l,f as g,g as k,h as C,i as h}from"./chunk-3SXTMY75.js";import{g as a}from"./chunk-A6RDYP6R.js";import{v as b}from"./chunk-MRCBHVSB.js";var u=v(),O=/\/\*\*\s*([\s\S]*?)\s*\*\//g,R=/export\s+(const|function|class|type|interface)\s+(\w+)/g,$=/@example/,S=s=>{let n=[],i;for(R.lastIndex=0;(i=R.exec(s))!==null;){let e=i.index,t=i[2];if(t===void 0)continue;let c=s.substring(0,e).split(`
|
|
3
3
|
`).length,p=null,m=[...s.substring(0,e).matchAll(O)];if(m.length>0){let r=m[m.length-1];if(r!==void 0){let d=(r.index??0)+r[0].length,f=s.substring(d,e);/^\s*$/.test(f)&&(p=r[1]??null)}}n.push({jsdoc:p,symbolName:t,line:c})}return n},_=(s,n,i)=>{let e=[];if(s===null)return e.push("missing-description"),e;let t=s.split(`
|
|
4
4
|
`)[0]?.trim();return(!t||t.startsWith("@"))&&e.push("empty-description"),i&&!$.test(s)&&e.push("missing-example"),e},F=async(s={})=>{let{root:n=".",requireExamples:i=!1}=s,e=await E(n),t=[],o=0,c=0;for(let p of e){let y=await I(p.path);for(let m of y){let r=A(m,p.path),d;try{d=await b.runtime.fs.readTextFile(r)}catch{continue}o++;let f=S(d);for(let{jsdoc:T,symbolName:x,line:P}of f){c++;let M=_(T,x,i);for(let N of M)t.push({file:r,symbol:x,issue:N,line:P})}}}return{isValid:t.length===0,issues:t,filesChecked:o,symbolsChecked:c}},J=s=>{switch(s){case"missing-description":return"Missing JSDoc documentation";case"missing-param":return"Missing @param documentation";case"missing-returns":return"Missing @returns documentation";case"missing-example":return"Missing @example";case"empty-description":return"Empty description"}},j=s=>D.fromPromise(()=>F(s)),V=s=>a.ok({root:"."}),q=s=>{if(a.isFail(s))return u.writeln(g("\u2717"),l(" "+String(s.error))),a.fail({exitCode:1});let{value:n}=s;if(u.writeln(h("\u2139"),l(` Checked ${n.filesChecked} files, ${n.symbolsChecked} symbols.`)),!n.isValid){u.writeln(g("\u2717"),l(` Found ${n.issues.length} documentation issues:`));let i=new Map;for(let e of n.issues){let t=i.get(e.file)??[];t.push(e),i.set(e.file,t)}for(let[e,t]of i){u.writeln(C("\u26A0"),l(" "+e));for(let o of t){let c=o.line!==void 0?`:${o.line}`:"";u.writeln(h("\u2139"),l(` ${o.symbol}${c}: ${J(o.issue)}`))}}return a.fail({exitCode:1})}return u.writeln(k("\u2713"),l(" All documentation is valid.")),a.ok(void 0)},B=w.createTrigger({handler:j,adaptInput:V,adaptOutput:q}),Q=async s=>await B({command:"validate-docs",args:[],flags:{}});export{F as a,j as b,B as c,Q as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as C,c as E}from"./chunk-
|
|
2
|
+
import{a as C,c as E}from"./chunk-KBFKBL6A.js";import{a as k}from"./chunk-2VEVVX6U.js";import{a as x}from"./chunk-4DOMGQOO.js";import{f as h}from"./chunk-3BEX5FYF.js";import{b as i,f as d,g as f,h as u,i as g}from"./chunk-3SXTMY75.js";import{g as n}from"./chunk-A6RDYP6R.js";import{v as c}from"./chunk-MRCBHVSB.js";var l=x(),b=t=>{let e=new Set,r=/export\s+\*\s+from\s+["']([^"']+)["']/g,a=/export\s+\{[^}]*\}\s+from\s+["']([^"']+)["']/g,o=/export\s+type\s+\{[^}]*\}\s+from\s+["']([^"']+)["']/g;for(let s of t.matchAll(r))s[1]!==void 0&&e.add(s[1]);for(let s of t.matchAll(a))s[1]!==void 0&&e.add(s[1]);for(let s of t.matchAll(o))s[1]!==void 0&&e.add(s[1]);return e},y=t=>{let e=t.startsWith("./")?t.slice(2):t;return e.endsWith(".ts")&&(e=e.slice(0,-3)),e},O=t=>!(t==="mod.ts"||t.endsWith("_test.ts")||t.endsWith("_bench.ts")||t.startsWith("_")||t.includes("/")),P=async(t={})=>{let{root:e=".",failFast:r=!1}=t,a=await C(e),o=[];for(let s of a){let v=c.runtime.path.join(s.path,"mod.ts"),m;try{m=await c.runtime.fs.readTextFile(v)}catch{continue}let M=b(m),w=new Set([...M].map(p=>y(p))),A=await E(s.path);for(let p of A){let R=c.runtime.path.basename(p);if(!O(R))continue;let F=y(p);if(!w.has(F)&&(o.push({packageName:s.name,file:p}),r))return{isComplete:!1,missingExports:o,packagesChecked:a.length}}}return{isComplete:o.length===0,missingExports:o,packagesChecked:a.length}},W=t=>h.fromPromise(()=>P(t)),_=t=>n.ok({root:"."}),z=t=>{if(n.isFail(t))return l.writeln(d("\u2717"),i(" "+String(t.error))),n.fail({exitCode:1});let{value:e}=t;if(l.writeln(g("\u2139"),i(` Checked ${e.packagesChecked} packages.`)),!e.isComplete){l.writeln(d("\u2717"),i(` Found ${e.missingExports.length} missing exports:`));for(let r of e.missingExports)l.writeln(u("\u26A0"),i(` ${r.packageName}: ${r.file}`));return n.fail({exitCode:1})}return l.writeln(f("\u2713"),i(" All mod.ts exports are complete.")),n.ok(void 0)},S=k.createTrigger({handler:W,adaptInput:_,adaptOutput:z}),N=async t=>await S({command:"validate-mod-exports",args:[],flags:{}});export{P as a,W as b,S as c,N as d};
|