Repository navigation
fix(run): don't print the built-in variables setup for .cfm templates - #26
Conversation
executeTemplate prepended the built-in variables setup (script) to the .cfm content as plain text. In a template, text outside <cfscript> is output, so 'lucli run hello.cfm' printed ~20 lines of setup code and an 'Original Script Content' marker before 'hello 2'. The setup now runs inside <cfscript> directly ahead of the unchanged template (wrapBuiltinSetupForTemplate), so the output is exactly the template's and the built-in variables stay available. .cfs scripts go through executeScriptContent and are unchanged. Upstream: cybersonic#137 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
|
rev1-r3 review @ c26936d: code APPROVE (final after the End to end (the RED/GREEN): JDK 21 jars, isolated
Nothing was written under the sandboxed Code: minimal. The setup runs inside Nits, not blocking:
Merge state: BLOCKED/conflicting on CHANGELOG/FORK.md as expected. I'll delta-check the |
Signed-off-by: Peter Amiri <peter@alurium.com> # Conflicts: # CHANGELOG.md # FORK.md
… the debug dump as a CFM template Review nits on #26. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
Integration Tests (ubuntu-latest, Java 21)78 tests 78 ✅ 1m 23s ⏱️ Results for commit 2ce882e. |
Unit Tests (ubuntu-latest, Java 21) 64 files 64 suites 2m 4s ⏱️ Results for commit 2ce882e. |
|
rev1-r3 review @ 2ce882e: APPROVE (final) There are two commits on top of the approved c26936d:
PR CI on this head: 8 pass (Build ×3, Unit ×3, Integration ×2); APT smoke skipped. mergeStateStatus is CLEAN. Ready to merge. |
- pom.xml version 0.6.2.3 (the Windows file/product version follows
${project.version}); install-validation default 0.6.2.3.
- FORK.md: 'Next queue' becomes the 0.6.2.3 queue (rows 8-15: #19,
#21-#24, #26-#28), with the row-8 compatibility note (Wheels 4.1.x
stays at max 0.6.2.2: no __lucliMcpCall handling), and a new empty
Next queue.
- CHANGELOG unchanged: fork entries stay under Unreleased, as for
0.6.2.2.
Sandboxed mvn test (-Duser.home only): 788 run, 0 failures.
Signed-off-by: Peter Amiri <peter@alurium.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Upstream issue: cybersonic#137
What
lucli run hello.cfm(with<cfoutput>hello #1+1#</cfoutput>) printed about 20 lines of setup code (// LuCLI Built-in Variables Setup,__scriptDir = '…', …,// === Original Script Content ===) beforehello 2..cfsfiles were not affected.Why
executeTemplate(the.cfmpath) prepended the built-in variables setup, which is CFML script, to the template as plain text. In a template, text outside<cfscript>is output.How
executeTemplatebuilds the content with a newwrapBuiltinSetupForTemplate(setup, template):<cfscript>+ setup +</cfscript>, then the template unchanged, with nothing in between. So the setup runs and the output is exactly what the template renders.injectBuiltinVariablesis unchanged for any other caller..cfsscripts go throughexecuteScriptContentand are untouched.Tests
New:
TemplatePreludeTest. The setup is inside<cfscript>, the template follows with nothing in between, there's no marker, and an empty or null setup leaves the template unchanged.End to end (isolated
LUCLI_HOME/-Duser.home):run hello.cfmhello 2hello 2run vars.cfm(<cfoutput>#listLast(__scriptPath, "/")#</cfoutput>)vars.cfmvars.cfmSo the variables are still available.
Full suite (
mvn test -DargLine="-Duser.home=<empty dir>"): 771 tests. The only failures are the 17 known clean-home failures that basewheelsshows under the same sandbox (Test suite isn't isolated from the developer's LuCLI home: writes into ~/.lucli, fails in a clean home #25); none are new. The real~/.lucliwas untouched. Unsandboxed, CI runs the normal way.Fork bookkeeping
CHANGELOG
## Unreleasedentry; FORK.md "Next queue" row 13. It will conflict on those two files with whichever of #22–#24 merges first; I'll mergewheelsin when it's this PR's turn.Upstream
The same change goes to
cybersonic/LuCLIas acherry-pick -xonto upstreammain(without FORK.md) once this is reviewed.🤖 Generated with Claude Code