Moved the shared filter engine into admin-x-framework - #29203
Conversation
- the filter AST/codec system and the value-source engine were shared across the posts app's comments and members domains, which dissolve into apps/admin in separate PRs; a workspace package can't import from apps/admin, so the shared code had to move to a neutral home both can reach - it's coupled to react-query (the value sources wrap the framework api hooks) and to the router, so framework is the correct home, not shade - exposed as @tryghost/admin-x-framework/filters and /filter-sources subpaths, mirroring the virtual-list primitive; get-site-timezone moved too, since comments/members/post-analytics all use it - the per-domain field definitions stay with their views and move later with their domain — only the shared primitives and value-source engine were extracted
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run @tryghost/admin-x-settings:test:acceptance |
✅ Succeeded | 11m 4s | View ↗ |
nx run ghost:test:ci:integration |
✅ Succeeded | 2m 52s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | <1s | View ↗ |
nx run-many -t test:unit -p @tryghost/admin-x-f... |
✅ Succeeded | 6m 9s | View ↗ |
nx run ghost:test:integration |
✅ Succeeded | 2m 52s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 3m 22s | View ↗ |
nx run ghost:test:legacy |
✅ Succeeded | 3m 26s | View ↗ |
nx run ghost-admin:test |
✅ Succeeded | 3m 53s | View ↗ |
Additional runs (9) |
✅ Succeeded | ... | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-07-09 15:52:44 UTC
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (58)
WalkthroughThis change introduces new public export entrypoints ( Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #29203 +/- ##
==========================================
- Coverage 74.07% 74.04% -0.03%
==========================================
Files 1570 1570
Lines 136629 136628 -1
Branches 16530 16521 -9
==========================================
- Hits 101204 101163 -41
- Misses 34419 34460 +41
+ Partials 1006 1005 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|

Extracts the posts app's shared filter engine into
@tryghost/admin-x-framework, so the domains that depend on it can dissolve intoapps/adminindependently. This is the last shared-infrastructure prerequisite for the posts co-location — the direct analog of the virtual-list primitive extraction (#29187).Why
The filter AST/codec system (
views/filters) and the value-source engine (hooks/filter-sources) are shared across the posts app's comments and members domains, which move intoapps/adminin separate PRs. The forcing case is concrete:usePostResourceValueSourceis consumed by bothcomments/components/comments-filters.tsxandmembers/components/members-filters.tsx. A workspace package can't import fromapps/admin, so once one of those domains moves, the shared code has to already live somewhere both can reach.It couples to react-query (the value sources wrap the framework
api/*hooks) and to the router, so framework is the correct home, not shade — the same rule that placed the virtual-list primitive.What changed
Extracted to framework, exposed as subpaths mirroring
virtual-list:@tryghost/admin-x-framework/filters—views/filters/*(filter-ast, filter-codecs, filter-types, filter-query-core, resolve-field, filter-normalization, filter-operator-options, filter-relative-date).@tryghost/admin-x-framework/filter-sources—hooks/filter-sources/*(thecreate-*-value-sourceengine + theuse-*-value-sourceleaf hooks).@tryghost/admin-x-framework/utils/get-site-timezone— used by comments, members, and post-analytics.The colocated tests moved with their subjects. The posts consumers are rewired to the new subpaths; the source directories are deleted.
What deliberately stayed in posts
The per-domain field definitions (
comment-fields,member-fields,*-filter-query,use-*-filter-fields,comments-filters,members-filters,resource-search-filter) live inside their views and move later with their domain — only their imports of the shared primitives were repointed.label-pickerandmember-routeare out of scope.Verification
pnpm --filter @tryghost/admin-x-framework build | lint | test— exit 0; 525 tests (was 451; the ~74 ported filter tests).pnpm --filter @tryghost/posts build | lint | test— exit 0; 404 tests (was 478; the filter tests moved to framework — 478 − 74 = 404).@src/views/filters/@src/hooks/filter-sources/get-site-timezonereferences remain inapps/posts/src; source dirs deleted.