task_progress 0.0.1
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +29 -0
- data/LICENSE +21 -0
- data/MANUAL.md +851 -0
- data/README.md +158 -0
- data/RECIPES.md +413 -0
- data/config/importmap.rb +17 -0
- data/exe/task_progress +51 -0
- data/js/local_tasks.d.ts +44 -0
- data/js/local_tasks.js +229 -0
- data/js/package.json +31 -0
- data/js/paths.d.ts +5 -0
- data/js/paths.js +7 -0
- data/js/react_task_tree.d.ts +49 -0
- data/js/react_task_tree.js +123 -0
- data/js/render_queue.d.ts +24 -0
- data/js/render_queue.js +79 -0
- data/js/row_view.d.ts +25 -0
- data/js/row_view.js +69 -0
- data/js/stimulus_controller.d.ts +10 -0
- data/js/stimulus_controller.js +137 -0
- data/js/task_progress_clock.d.ts +2 -0
- data/js/task_progress_clock.js +33 -0
- data/js/task_tree.css +51 -0
- data/js/task_tree.d.ts +111 -0
- data/js/task_tree.js +444 -0
- data/lib/task_progress/assertions.rb +49 -0
- data/lib/task_progress/batch.rb +23 -0
- data/lib/task_progress/branch.rb +74 -0
- data/lib/task_progress/buffered_output.rb +63 -0
- data/lib/task_progress/cancellations_app.rb +76 -0
- data/lib/task_progress/event.rb +46 -0
- data/lib/task_progress/execution_log_output.rb +183 -0
- data/lib/task_progress/fold.rb +18 -0
- data/lib/task_progress/html_renderer.rb +153 -0
- data/lib/task_progress/job_serializer.rb +92 -0
- data/lib/task_progress/journal.rb +35 -0
- data/lib/task_progress/log.rb +263 -0
- data/lib/task_progress/memory_cache.rb +31 -0
- data/lib/task_progress/memory_stream_store.rb +142 -0
- data/lib/task_progress/mount.rb +448 -0
- data/lib/task_progress/ndjson_output.rb +24 -0
- data/lib/task_progress/node.rb +52 -0
- data/lib/task_progress/poll.rb +87 -0
- data/lib/task_progress/publishing_output.rb +30 -0
- data/lib/task_progress/ractor_output.rb +23 -0
- data/lib/task_progress/rails_defaults.rb +46 -0
- data/lib/task_progress/railtie.rb +91 -0
- data/lib/task_progress/recording_output.rb +51 -0
- data/lib/task_progress/redis_stream_store.rb +131 -0
- data/lib/task_progress/squasher.rb +59 -0
- data/lib/task_progress/sse.rb +114 -0
- data/lib/task_progress/state.rb +319 -0
- data/lib/task_progress/stream_output.rb +222 -0
- data/lib/task_progress/stream_reader.rb +76 -0
- data/lib/task_progress/summary_output.rb +37 -0
- data/lib/task_progress/terminal_output.rb +241 -0
- data/lib/task_progress/token.rb +58 -0
- data/lib/task_progress/tracked_io.rb +68 -0
- data/lib/task_progress/transaction.rb +41 -0
- data/lib/task_progress/trees_app.rb +66 -0
- data/lib/task_progress/turbo_helper.rb +18 -0
- data/lib/task_progress/turbo_sse.rb +103 -0
- data/lib/task_progress/turbo_stream_output.rb +61 -0
- data/lib/task_progress/version.rb +7 -0
- data/lib/task_progress/wire.rb +211 -0
- data/lib/task_progress.rb +1036 -0
- data/sig/generated/task_progress/assertions.rbs +36 -0
- data/sig/generated/task_progress/batch.rbs +33 -0
- data/sig/generated/task_progress/branch.rbs +47 -0
- data/sig/generated/task_progress/buffered_output.rbs +38 -0
- data/sig/generated/task_progress/cancellations_app.rbs +41 -0
- data/sig/generated/task_progress/event.rbs +20 -0
- data/sig/generated/task_progress/execution_log_output.rbs +93 -0
- data/sig/generated/task_progress/fold.rbs +25 -0
- data/sig/generated/task_progress/html_renderer.rbs +71 -0
- data/sig/generated/task_progress/journal.rbs +25 -0
- data/sig/generated/task_progress/log.rbs +140 -0
- data/sig/generated/task_progress/memory_cache.rbs +28 -0
- data/sig/generated/task_progress/memory_stream_store.rbs +83 -0
- data/sig/generated/task_progress/mount.rbs +200 -0
- data/sig/generated/task_progress/ndjson_output.rbs +18 -0
- data/sig/generated/task_progress/node.rbs +66 -0
- data/sig/generated/task_progress/poll.rbs +50 -0
- data/sig/generated/task_progress/publishing_output.rbs +24 -0
- data/sig/generated/task_progress/ractor_output.rbs +17 -0
- data/sig/generated/task_progress/rails_defaults.rbs +33 -0
- data/sig/generated/task_progress/recording_output.rbs +41 -0
- data/sig/generated/task_progress/redis_stream_store.rbs +75 -0
- data/sig/generated/task_progress/squasher.rbs +20 -0
- data/sig/generated/task_progress/sse.rbs +73 -0
- data/sig/generated/task_progress/state.rbs +165 -0
- data/sig/generated/task_progress/stream_output.rbs +142 -0
- data/sig/generated/task_progress/stream_reader.rbs +46 -0
- data/sig/generated/task_progress/summary_output.rbs +19 -0
- data/sig/generated/task_progress/terminal_output.rbs +117 -0
- data/sig/generated/task_progress/token.rbs +41 -0
- data/sig/generated/task_progress/tracked_io.rbs +48 -0
- data/sig/generated/task_progress/transaction.rbs +33 -0
- data/sig/generated/task_progress/trees_app.rbs +40 -0
- data/sig/generated/task_progress/turbo_helper.rbs +14 -0
- data/sig/generated/task_progress/turbo_sse.rbs +69 -0
- data/sig/generated/task_progress/turbo_stream_output.rbs +51 -0
- data/sig/generated/task_progress/version.rbs +6 -0
- data/sig/generated/task_progress/wire.rbs +102 -0
- data/sig/generated/task_progress.rbs +553 -0
- metadata +178 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: bba7d16d891602fcbf40cd7c68d22557ff064cffeffc85c4e94427a820522632
|
|
4
|
+
data.tar.gz: c06b56589b97b8b35f4026d2a4456e2fedeb9fc927ea8bfa8e731ef4c173d0df
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: b620b67a533baf826a1e3b8e031b9d7028cd0436a8a9f97dc37764096c0080ea9b24513ff484c6164469268ec8a6965c0d61519abe3e9fdd09726ed2cad53e57
|
|
7
|
+
data.tar.gz: 286221b3d27aaf06f1310c44031f3343e48207d2ec76b6b06b766aa8c0858082cfabc752389e0f4d9cd1660b4f0f12b0b7c8447088d56d68e76b4df8b6a4632e
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.0.1 - unreleased
|
|
4
|
+
|
|
5
|
+
The first release, to try out in real apps before the API settles for 1.0. TaskProgress was extracted from ghost_ink and rebuilt on an event log; there
|
|
6
|
+
is nothing before it to be compatible with.
|
|
7
|
+
|
|
8
|
+
- Progress as a log of change events, committed as numbered batches under one lock, and squashed for whoever joins late.
|
|
9
|
+
- Trees of tasks: counted, weighted, indeterminate, expected. A task finishes at its total, and a parent only once everything under it ends.
|
|
10
|
+
- Bars, `iterate`, `track_io` (with progressive_io), and a CLI that draws a tree on a terminal and an execution log on CI.
|
|
11
|
+
- Outputs: a terminal, an execution log, NDJSON, buffered and squashed, a Ractor port, Turbo Streams, any lambda.
|
|
12
|
+
- Mounts: subtrees fed from subprocesses (over a pipe, with cancels going the other way), Ractors (Ruby 4.0) and streams.
|
|
13
|
+
- Canceling, from any thread or from outside, with signed cancel tokens and a cancellations resource.
|
|
14
|
+
- Handing work off through a stream - in memory, or Redis - to a job or a worker anywhere: `handoff`, `adopt`, `follow`, `fetch`. Followers notice a worker that went away, and a retry starts the tree over as the next attempt.
|
|
15
|
+
- One run writes a handed-off tree at a time: a run that was taken over from cannot take it back, cancel requests name the run they are for, and a write that fails is made good by the next.
|
|
16
|
+
- ActiveJob: a tree is a job argument like any other, and the job's `perform` is its work.
|
|
17
|
+
- Server-Sent Events, long polling, and a browser client with Stimulus and React on top - drawn once a frame, with tasks that run in the browser grafted under the server's.
|
|
18
|
+
- Turbo: a tree drawn as HTML and morphed into every page that shows it, from wherever the job runs.
|
|
19
|
+
- Big trees fold their finished and waiting siblings into a row each, in every renderer.
|
|
20
|
+
- `task_progress watch KEY` draws a handed-off tree in a terminal.
|
|
21
|
+
- `TaskProgress.for_page(key)` hands a page signed links to a handed-off tree and its snapshot, which `TreesApp` - mounted by the Railtie - answers; the key never leaves the server. React gets `useTaskTree(progress)` and `<TaskTreeView progress onComplete onFail>`, Stimulus a `progress` value, and both fall back from SSE to polling by themselves.
|
|
22
|
+
- The browser client comes with TypeScript declarations. `task_progress vendor` (or `rails task_progress:vendor`) copies it into an app as the `task_progress` package, for Vite or esbuild; with importmap-rails, the Railtie pins `task_progress`, `task_progress/react` and the rest by itself. Rails warns at boot when a vendored copy is from another version of the gem.
|
|
23
|
+
- Tasks that run in the browser can be drawn on their own, with no server tree: `followLocal(work)`, `<TaskTreeView local={work} />`, or the Stimulus controller's `show(work)`. RECIPES.md has upload progress done that way.
|
|
24
|
+
- Stream stores take a `namespace:`; an unset one raises in production rather than keep trees in one process.
|
|
25
|
+
- In Rails, the browser client is served at `/task_progress/js`, and cancel buttons send the page's CSRF token.
|
|
26
|
+
- RECIPES.md: whole setups to start from.
|
|
27
|
+
- Test helpers: `outline`, `RecordingOutput`, `TaskProgress::Assertions`.
|
|
28
|
+
- The wire format carries its version, `v: 1`; readers drop batches in any other.
|
|
29
|
+
- Typed with inline RBS, checked by Steep; the signatures ship with the gem.
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Julik Tarkhanov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|