[PR #5837] [MERGED] ♻️ refactor rules code #55460

Closed
opened 2026-05-01 02:22:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/5837
Author: @matt-fidd
Created: 10/2/2025
Status: Merged
Merged: 10/5/2025
Merged by: @matt-fidd

Base: masterHead: refactor-rules


📝 Commits (10+)

📊 Changes

8 files changed (+1295 additions, -1238 deletions)

View changed files

packages/loot-core/src/server/rules/action.ts (+148 -0)
packages/loot-core/src/server/rules/condition.ts (+436 -0)
packages/loot-core/src/server/rules/handlebars-helpers.ts (+131 -0)
📝 packages/loot-core/src/server/rules/index.ts (+18 -1238)
packages/loot-core/src/server/rules/rule-indexer.ts (+89 -0)
packages/loot-core/src/server/rules/rule-utils.ts (+274 -0)
packages/loot-core/src/server/rules/rule.ts (+193 -0)
upcoming-release-notes/5837.md (+6 -0)

📄 Description

I was looking at this to expand/change the rule action templating and it felt a bit big and busy. This breaks it down into more manageable files. It's best to review by commit

Should be 1:1 for the migration, with the commits that change things at the end to make review easier. Checked by running rules on every transaction in my budget, and no errors so it seems to be working.

This should be the first step in switching the rule action templating language from handlebars to a more user friendly/familiar style.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/5837 **Author:** [@matt-fidd](https://github.com/matt-fidd) **Created:** 10/2/2025 **Status:** ✅ Merged **Merged:** 10/5/2025 **Merged by:** [@matt-fidd](https://github.com/matt-fidd) **Base:** `master` ← **Head:** `refactor-rules` --- ### 📝 Commits (10+) - [`565091e`](https://github.com/actualbudget/actual/commit/565091e2ef32cef28acf6ffaa8eac49891e4f9c9) extract handlebars helpers - [`bd4ae0b`](https://github.com/actualbudget/actual/commit/bd4ae0bf8f4ad265d890efee891bf7afbdf21d0b) extract condition types - [`e567a38`](https://github.com/actualbudget/actual/commit/e567a38dbbf7efe9c0d3124003cdfa5689b353dc) extract condition class - [`0987cd7`](https://github.com/actualbudget/actual/commit/0987cd7338401f51bbe2bc24d13c2b9c6ab469ed) extract action class - [`0dcba70`](https://github.com/actualbudget/actual/commit/0dcba70327230946119be988bc095f3cbe77c9b2) extract rule class - [`21f7d2e`](https://github.com/actualbudget/actual/commit/21f7d2ebcfcea95f8d57cecd3c89d3b559c52e86) extract rule indexer - [`0786c68`](https://github.com/actualbudget/actual/commit/0786c68c3c099d81b263003458a160bd8b4f23df) extract rule utils - [`f9ef60e`](https://github.com/actualbudget/actual/commit/f9ef60e1c7fa71485f1dcfe43e375cb6f0af1882) update main index - [`41dd0be`](https://github.com/actualbudget/actual/commit/41dd0beebd3f54fb51a45fc021b6bf06827d9ab4) note - [`86fee7b`](https://github.com/actualbudget/actual/commit/86fee7bd5cdd1d8933e595602aea29e5a9530ef8) enable strict where able ### 📊 Changes **8 files changed** (+1295 additions, -1238 deletions) <details> <summary>View changed files</summary> ➕ `packages/loot-core/src/server/rules/action.ts` (+148 -0) ➕ `packages/loot-core/src/server/rules/condition.ts` (+436 -0) ➕ `packages/loot-core/src/server/rules/handlebars-helpers.ts` (+131 -0) 📝 `packages/loot-core/src/server/rules/index.ts` (+18 -1238) ➕ `packages/loot-core/src/server/rules/rule-indexer.ts` (+89 -0) ➕ `packages/loot-core/src/server/rules/rule-utils.ts` (+274 -0) ➕ `packages/loot-core/src/server/rules/rule.ts` (+193 -0) ➕ `upcoming-release-notes/5837.md` (+6 -0) </details> ### 📄 Description I was looking at this to expand/change the rule action templating and it felt a bit big and busy. This breaks it down into more manageable files. It's best to review by commit Should be 1:1 for the migration, with the commits that change things at the end to make review easier. Checked by running rules on every transaction in my budget, and no errors so it seems to be working. This should be the first step in switching the rule action templating language from handlebars to a more user friendly/familiar style. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-01 02:22:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#55460