source_monitor 0.1.2 → 0.2.0

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.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +32 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +25 -1
  5. data/app/assets/javascripts/source_monitor/application.js +4 -0
  6. data/app/assets/javascripts/source_monitor/controllers/confirm_navigation_controller.js +49 -0
  7. data/app/assets/javascripts/source_monitor/controllers/select_all_controller.js +36 -0
  8. data/app/controllers/source_monitor/import_sessions_controller.rb +791 -0
  9. data/app/controllers/source_monitor/sources_controller.rb +5 -36
  10. data/app/helpers/source_monitor/application_helper.rb +17 -0
  11. data/app/jobs/source_monitor/import_opml_job.rb +150 -0
  12. data/app/jobs/source_monitor/import_session_health_check_job.rb +93 -0
  13. data/app/models/source_monitor/import_history.rb +35 -0
  14. data/app/models/source_monitor/import_session.rb +34 -0
  15. data/app/views/source_monitor/import_sessions/_header.html.erb +12 -0
  16. data/app/views/source_monitor/import_sessions/_sidebar.html.erb +23 -0
  17. data/app/views/source_monitor/import_sessions/health_check/_progress.html.erb +20 -0
  18. data/app/views/source_monitor/import_sessions/health_check/_row.html.erb +44 -0
  19. data/app/views/source_monitor/import_sessions/show.html.erb +15 -0
  20. data/app/views/source_monitor/import_sessions/show.turbo_stream.erb +1 -0
  21. data/app/views/source_monitor/import_sessions/steps/_configure.html.erb +53 -0
  22. data/app/views/source_monitor/import_sessions/steps/_confirm.html.erb +121 -0
  23. data/app/views/source_monitor/import_sessions/steps/_health_check.html.erb +82 -0
  24. data/app/views/source_monitor/import_sessions/steps/_navigation.html.erb +29 -0
  25. data/app/views/source_monitor/import_sessions/steps/_preview.html.erb +172 -0
  26. data/app/views/source_monitor/import_sessions/steps/_upload.html.erb +42 -0
  27. data/app/views/source_monitor/sources/_form.html.erb +8 -138
  28. data/app/views/source_monitor/sources/_form_fields.html.erb +142 -0
  29. data/app/views/source_monitor/sources/_import_history_panel.html.erb +53 -0
  30. data/app/views/source_monitor/sources/index.html.erb +7 -1
  31. data/config/coverage_baseline.json +91 -15
  32. data/config/routes.rb +6 -0
  33. data/db/migrate/20251124090000_create_import_sessions.rb +18 -0
  34. data/db/migrate/20251124153000_add_health_fields_to_import_sessions.rb +14 -0
  35. data/db/migrate/20251125094500_create_import_histories.rb +19 -0
  36. data/docs/setup.md +13 -1
  37. data/lib/source_monitor/health/import_source_health_check.rb +55 -0
  38. data/lib/source_monitor/health.rb +1 -0
  39. data/lib/source_monitor/import_sessions/entry_normalizer.rb +30 -0
  40. data/lib/source_monitor/import_sessions/health_check_broadcaster.rb +103 -0
  41. data/lib/source_monitor/sources/params.rb +52 -0
  42. data/lib/source_monitor/version.rb +1 -1
  43. data/tasks/completed/codebase_audit_2025.md +1396 -0
  44. data/tasks/completed/engine-asset-configuration.md +203 -0
  45. data/tasks/completed/opml-import-wizard/opml-import-wizard-product-brief.md +58 -0
  46. data/tasks/completed/opml-import-wizard/opml-import-wizard-tech-brief.md +75 -0
  47. data/tasks/completed/opml-import-wizard/task-01/instructions.md +81 -0
  48. data/tasks/completed/opml-import-wizard/task-01/requirements.md +19 -0
  49. data/tasks/completed/opml-import-wizard/task-02/instructions.md +83 -0
  50. data/tasks/completed/opml-import-wizard/task-02/requirements.md +18 -0
  51. data/tasks/completed/opml-import-wizard/task-03/instructions.md +58 -0
  52. data/tasks/completed/opml-import-wizard/task-03/requirements.md +18 -0
  53. data/tasks/completed/opml-import-wizard/task-04/instructions.md +84 -0
  54. data/tasks/completed/opml-import-wizard/task-04/requirements.md +17 -0
  55. data/tasks/completed/opml-import-wizard/task-05/instructions.md +50 -0
  56. data/tasks/completed/opml-import-wizard/task-05/requirements.md +17 -0
  57. data/tasks/completed/opml-import-wizard/task-06/instructions.md +92 -0
  58. data/tasks/completed/opml-import-wizard/task-06/requirements.md +21 -0
  59. data/tasks/completed/phase_17_01_complexity_audit_2025-10-12.md +62 -0
  60. data/tasks/completed/phase_17_02_complexity_findings_2025-10-12.md +74 -0
  61. data/tasks/completed/phase_17_03_refactor_plan_2025-10-12.md +37 -0
  62. data/tasks/completed/phase_21_01_log_consolidation_2025-10-15.md +30 -0
  63. data/tasks/completed/release_checklist.md +23 -0
  64. data/tasks/completed/routes_refactor_evaluation.md +109 -0
  65. data/tasks/completed/source_monitor_rename_plan.md +70 -0
  66. data/tasks/completed/tasks.md +952 -0
  67. data/tasks/ideas.md +10 -0
  68. metadata +56 -3
  69. /data/tasks/{prd-setup-workflow-streamlining.md → completed/prd-setup-workflow-streamlining.md} +0 -0
  70. /data/tasks/{tasks-setup-workflow-streamlining.md → completed/tasks-setup-workflow-streamlining.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3831f3ec3fa841e1e15fb16fc7ab780177d35353fce96975338c2e7aa129bd9f
4
- data.tar.gz: ac970a0b226c1b8c1c9a266a892754941d92173b8753ac37d2a4cd89f1895fd9
3
+ metadata.gz: bd1d2946507443d80b3adc99bc086b6c773edf86618754a041c9139ae8763b84
4
+ data.tar.gz: 18dde3e77a9d466268c1d868bf7ff0de3cee1f99486a007c6f962d4499e0c843
5
5
  SHA512:
6
- metadata.gz: 46dc5a034c7b7c294877d124a59b632aec2cfbc420544835b06d0809a7e8d574930ffc86cd5bfbceb436516a0bc88b55ffdb34a38a0bb873ae3892bb3615b503
7
- data.tar.gz: 542c9c82713daadb6f0cfa4151ab99df55440a8e86a553ee46b2223806096f6d36d1e1987890f50aaad83132498c674793cae11c11752a897daca6c36efb1a94
6
+ metadata.gz: 1e272942510d791f2f0dc1944b12e561ee9461821cd95faaa761fc0ec1eb1c40b1a58ac37eabd3d9a6d2ba29fe210d0a9fd0bc93e732aad0c864fc471a652b27
7
+ data.tar.gz: 772e12e49fad3658facfd044d839d7864c0c377577927f239c43c4d7ab09636b71a539ad41f8ef06bbb2f6e02bcdd25c9815f040cd6c8f068d549b5031da762b
data/CHANGELOG.md CHANGED
@@ -15,6 +15,38 @@ All notable changes to this project are documented below. The format follows [Ke
15
15
 
16
16
  - No unreleased changes yet.
17
17
 
18
+ ## [0.2.0] - 2025-11-25
19
+
20
+ ### Added
21
+
22
+ - OPML import wizard with multi-step flow (upload, preview with selection, health checks, bulk configure, confirm) and Turbo-powered navigation.
23
+ - Health check enqueuing for selected feeds plus realtime Turbo Stream row/progress updates during the wizard.
24
+ - Bulk configuration reuse of source form fields with identity fields hidden for batch apply.
25
+ - Background OPML import job with ImportHistory persistence, per-source success/failure/duplicate tracking, and Turbo broadcast of results to the Sources index.
26
+ - Sources index “Recent OPML import” panel surfacing latest ImportHistory (counts, failures).
27
+
28
+ ### Changed
29
+
30
+ - Shared source params helper for defaults/permitted attributes to drive bulk settings and single-source forms consistently.
31
+ - Wizard fallback auth handling for unauthenticated host apps to enable usage in simple dummy setups.
32
+
33
+ ### Testing
34
+
35
+ - `rbenv exec bundle exec rubocop`
36
+ - `rbenv exec ruby bin/rails test`
37
+ - `./bin/test-coverage`
38
+ - `rbenv exec ruby bin/check-diff-coverage`
39
+
40
+ ## [0.1.3] - 2025-11-13
41
+
42
+ ### Added
43
+
44
+ - Clarified installation instructions for consumers: add `gem "source_monitor"` via RubyGems before running the guided workflow (README + docs/setup.md).
45
+
46
+ ### Testing
47
+
48
+ - Documentation-only update; no code changes.
49
+
18
50
  ## [0.1.2] - 2025-11-13
19
51
 
20
52
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- source_monitor (0.1.2)
4
+ source_monitor (0.2.0)
5
5
  cssbundling-rails (~> 1.4)
6
6
  faraday (~> 2.9)
7
7
  faraday-follow_redirects (~> 0.4)
data/README.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  SourceMonitor is a production-ready Rails 8 mountable engine for ingesting, normalising, scraping, and monitoring RSS/Atom/JSON feeds. It ships with a Tailwind-powered admin UI, Solid Queue job orchestration, Solid Cable realtime broadcasting, and an extensible configuration layer so host applications can offer full-stack feed operations without rebuilding infrastructure.
4
4
 
5
+ > **Note:** Application developers consume SourceMonitor via RubyGems—add the gem to your host application's Gemfile and follow the guided installer. Clone this repository only when contributing to the engine itself.
6
+
7
+ ## Installation (RubyGems)
8
+
9
+ In your host Rails app:
10
+
11
+ ```bash
12
+ bundle add source_monitor --version "~> 0.1.2"
13
+ # or add `gem "source_monitor", "~> 0.1.2"` manually, then run:
14
+ bundle install
15
+ ```
16
+
17
+ This exposes `bin/source_monitor` (via Bundler binstubs) so you can run the guided workflow described below.
18
+
5
19
  ## Highlights
6
20
  - Full-featured source and item administration backed by Turbo Streams and Tailwind UI components
7
21
  - Adaptive fetch pipeline (Feedjira + Faraday) with conditional GETs, retention pruning, and scrape orchestration
@@ -22,6 +36,16 @@ SourceMonitor is a production-ready Rails 8 mountable engine for ingesting, norm
22
36
 
23
37
  > **Command prefixes:** Examples below show bare `bundle`, `bin/rails`, and `bin/source_monitor`. If you use rbenv/asdf or containerized tooling, prefix/adjust commands accordingly so they run inside your Ruby environment.
24
38
 
39
+ ### Install the Gem
40
+
41
+ Before running any SourceMonitor commands inside your host app, add the gem and install dependencies:
42
+
43
+ ```bash
44
+ bundle add source_monitor --version "~> 0.1.2"
45
+ # or edit your Gemfile, then run
46
+ bundle install
47
+ ```
48
+
25
49
  ### Recommended: Guided Workflow
26
50
  1. **Optional prerequisite check:** `bin/rails source_monitor:setup:check`
27
51
  2. **Run the guided installer:** `bin/source_monitor install --yes`
@@ -30,7 +54,7 @@ SourceMonitor is a production-ready Rails 8 mountable engine for ingesting, norm
30
54
  4. **Verify anytime:** `bin/source_monitor verify` (also exposed as `bin/rails source_monitor:setup:verify`). The command prints a human summary plus JSON so CI can gate on Solid Queue and Action Cable health.
31
55
  5. **Visit the dashboard** at the chosen mount path and trigger “Fetch Now” on a source to confirm everything is wired.
32
56
 
33
- See [docs/setup.md](docs/setup.md) for the full workflow (prereq table, rollback steps, telemetry flag, Devise system test template).
57
+ See [docs/setup.md](docs/setup.md) for the full workflow (prereq table, gem installation, rollback steps, telemetry flag, Devise system test template).
34
58
 
35
59
  ### Manual Install (Advanced)
36
60
  Prefer explicit Rails generator steps or need to customize each phase? The same document covers a full **Manual Installation** section so you can copy/paste each command into bespoke pipelines.
@@ -3,6 +3,8 @@ import AsyncSubmitController from "./controllers/async_submit_controller";
3
3
  import NotificationController from "./controllers/notification_controller";
4
4
  import DropdownController from "./controllers/dropdown_controller";
5
5
  import ModalController from "./controllers/modal_controller";
6
+ import ConfirmNavigationController from "./controllers/confirm_navigation_controller";
7
+ import SelectAllController from "./controllers/select_all_controller";
6
8
  import "./turbo_actions";
7
9
 
8
10
  const existingApplication = window.SourceMonitorStimulus;
@@ -16,5 +18,7 @@ application.register("notification", NotificationController);
16
18
  application.register("async-submit", AsyncSubmitController);
17
19
  application.register("dropdown", DropdownController);
18
20
  application.register("modal", ModalController);
21
+ application.register("confirm-navigation", ConfirmNavigationController);
22
+ application.register("select-all", SelectAllController);
19
23
 
20
24
  export default application;
@@ -0,0 +1,49 @@
1
+ import { Controller } from "@hotwired/stimulus";
2
+
3
+ export default class extends Controller {
4
+ static values = {
5
+ message: {
6
+ type: String,
7
+ default: "You have unsaved changes. Are you sure you want to leave this page?"
8
+ }
9
+ };
10
+
11
+ connect() {
12
+ this.boundBeforeUnload = this.beforeUnload.bind(this);
13
+ this.boundTurboVisit = this.beforeTurboVisit.bind(this);
14
+
15
+ window.addEventListener("beforeunload", this.boundBeforeUnload);
16
+ document.addEventListener("turbo:before-visit", this.boundTurboVisit);
17
+ }
18
+
19
+ disconnect() {
20
+ this.removeGuards();
21
+ }
22
+
23
+ disable() {
24
+ this.removeGuards();
25
+ }
26
+
27
+ beforeUnload(event) {
28
+ event.preventDefault();
29
+ event.returnValue = this.messageValue;
30
+ return this.messageValue;
31
+ }
32
+
33
+ beforeTurboVisit(event) {
34
+ if (this.skipPrompt) return;
35
+
36
+ if (!window.confirm(this.messageValue)) {
37
+ event.preventDefault();
38
+ return;
39
+ }
40
+
41
+ this.skipPrompt = true;
42
+ this.removeGuards();
43
+ }
44
+
45
+ removeGuards() {
46
+ window.removeEventListener("beforeunload", this.boundBeforeUnload);
47
+ document.removeEventListener("turbo:before-visit", this.boundTurboVisit);
48
+ }
49
+ }
@@ -0,0 +1,36 @@
1
+ import { Controller } from "@hotwired/stimulus";
2
+
3
+ export default class extends Controller {
4
+ static targets = ["master", "item"];
5
+
6
+ connect() {
7
+ this.syncMaster();
8
+ }
9
+
10
+ itemTargetConnected() {
11
+ this.syncMaster();
12
+ }
13
+
14
+ itemTargetDisconnected() {
15
+ this.syncMaster();
16
+ }
17
+
18
+ toggleAll(event) {
19
+ const checked = event.target.checked;
20
+ this.itemTargets.forEach((checkbox) => {
21
+ if (checkbox.disabled) return;
22
+ checkbox.checked = checked;
23
+ });
24
+ }
25
+
26
+ toggleItem() {
27
+ this.syncMaster();
28
+ }
29
+
30
+ syncMaster() {
31
+ if (!this.hasMasterTarget) return;
32
+ const selectable = this.itemTargets.filter((checkbox) => !checkbox.disabled);
33
+ const allChecked = selectable.length > 0 && selectable.every((checkbox) => checkbox.checked);
34
+ this.masterTarget.checked = allChecked;
35
+ }
36
+ }