• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

accordproject / template-engine / 37498790105
73%

Build:
DEFAULT BRANCH: main
Ran 06 Oct 2026 04:51PM UTC
Jobs 3
Files 34
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Oct 2026 04:49PM UTC coverage: 72.661% (+0.6%) from 72.093%
37498790105

push

github

web-flow
fix: draft() can't resolve TypeScript helper functions defined in logic/logic.ts (#147) (#150)

* fix: draft() can't resolve TypeScript helper functions defined in logic/logic.ts (#147)

TemplateArchiveProcessor.draft() compiled inline formulas (`{{% expr %}}`)
with a TypeScript context that did not include the template's user code
from `logic/logic.ts`. Helper functions like `monthlyPaymentFormula(...)`
therefore produced `Cannot find name 'monthlyPaymentFormula'` (TS2304).

trigger() and init() already loaded logic/logic.ts via the
TypeScriptToJavaScriptCompiler. This change:

- Extracts that compilation into a shared `compileUserLogic` helper
  (src/UserLogic.ts) which returns the compiled JS along with the
  top-level identifiers it declares.
- Adds `declare const <name>: any;` stubs to the formula compile
  context for each of those identifiers, so user helpers resolve at
  compile time.
- Splices the stripped logic.ts JS into the formula function body at
  runtime, so the same identifiers are real values at evaluation time.
- Refactors trigger() and init() to use the new shared helper, so
  draft() and trigger()/init() now use the same logic-loading path.

Adds a fixture (test/archives/formula-uses-logic-helper) and a unit
test that confirms draft() can call helpers from logic/logic.ts.

Signed-off-by: Claude <noreply@anthropic.com>

* fix: fully escape user logic symbol names when building regex

Addresses the CodeQL incomplete-escaping finding in usesUserLogic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012UGdBxqqBziX4u42rcjxRA
Signed-off-by: Matt Roberts <code@rbrts.uk>

---------

Signed-off-by: Claude <noreply@anthropic.com>
Signed-off-by: Matt Roberts <code@rbrts.uk>
Co-authored-by: Claude <noreply@anthropic.com>

717 of 1137 branches covered (63.06%)

Branch coverage included in aggregate %.

69 of 73 new or added lines in 6 files covered. (94.52%)

1263 of 1588 relevant lines covered (79.53%)

2917.3 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
79.14
-1.97% src/TemplateArchiveProcessor.ts
Jobs
ID Job ID Ran Files Coverage
1 windows-latest - 37498790105.1 06 Oct 2026 04:53PM UTC 67
75.0
GitHub Action Run
2 macos-latest - 37498790105.2 06 Oct 2026 04:52PM UTC 67
75.0
GitHub Action Run
3 ubuntu-latest - 37498790105.3 06 Oct 2026 04:51PM UTC 67
75.0
GitHub Action Run
Source Files on build 37498790105
  • Tree
  • List 34
  • Changed 25
  • Source Changed 5
  • Coverage Changed 25
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #37498790105
  • 1b877221 on github
  • Prev Build on main (#37497374185)
  • Next Build on main (#37513162597)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc