Commit 9a9221a
Feat/reporter extension (#463)
* feat: add initial reporter extension
* feat: add deploy, codegen, and dev hooks
* feat: add config parsing for extensions
* feat: add documentation
* feat: clean up build output and allow verbose flag
* feat: test all extension hooks
* chore: add tests for reporter
* chore: format
* chore: fix Rust versions
* fix: deprecated cargo_bin macro
* fix: add workaround for reporter dependency in tests
* chore: move Reporter tests to own crate
* fix: build hook test
* fix: reporter integration test
* feat: add unchanged deploy state
* fix: address review findings on reporter extension (#472)
- state::save now returns io::Result and callers log on failure via a
save_state helper, instead of silently dropping state writes
- read_stdin returns Option<T>; the reporter logs a diagnostic and
degrades gracefully on bad input instead of panicking and surfacing
as a non-zero extension exit
- HookName and DeployKind are marked #[non_exhaustive] so adding a
hook or deploy kind in the future is not a breaking change for
external extension authors consuming stellar-scaffold-ext-types
- Drop unused thiserror dependency from the reporter crate
- Remove a stale TODO comment in report.rs whose behavior is already
correct
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: ensure post-codegen hook fires on error and propagate codegen failures
`generate_contract_bindings` previously short-circuited via `?` inside the
rebuild block, so PostCodegen was skipped whenever any inner step (bindings
typescript, npm install/build, fs ops, create_contract_template) returned
Err. Combined with `handle_contracts` swallowing per-contract errors, this
made the build exit 0 while a hook that consumers rely on never fired —
exactly the failure mode of `extension_hooks_fire_in_order`.
Restructure so PostCodegen always fires after the fallible work, then
propagate the error via a new CodegenStepFailed variant. `handle_contracts`
now counts failures and returns ContractClientFailures so a broken codegen
step can no longer masquerade as a successful build. Adds a regression test
that shims npm to fail and asserts both pre- and post-codegen still appear.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* revert: restore non-fatal handle_contracts; drop ContractClientFailures
Reverts the handle_contracts change from 590a1a5. That commit made
per-contract codegen failures propagate as a build error, but
`build_clients::contracts::contracts_with_failures_show_summary` explicitly
asserts `build.success()` while showing per-contract success/fail messages —
non-fatal contract failures are documented behavior, not an oversight.
Propagation also surfaced pre-existing real codegen failures in several
example contracts (case_02_account, case_17, case_18) that had been
silently swallowed; restoring or expecting those is out of scope for this
fix.
The PostCodegen-on-error fix and its regression test remain.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Willem Wyndham <willem@ahalabs.dev>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 3af770e commit 9a9221a
23 files changed
Lines changed: 1819 additions & 272 deletions
File tree
- .github/workflows
- crates
- stellar-scaffold-cli
- src
- commands
- build
- watch
- tests/it
- build_clients
- features
- stellar-scaffold-ext-types
- src
- stellar-scaffold-reporter
- src
- tests
- website
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
146 | 168 | | |
147 | 169 | | |
148 | 170 | | |
| |||
248 | 270 | | |
249 | 271 | | |
250 | 272 | | |
251 | | - | |
| 273 | + | |
252 | 274 | | |
253 | 275 | | |
254 | 276 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
3 | 23 | | |
0 commit comments