Template marketplace: quality signals, new examples, better search, safe installs#233
Merged
Nanle-code merged 5 commits intoMay 30, 2026
Conversation
Closes Nanle-code#216 Surface lightweight quality signals so users can identify dependable templates more easily in a growing community catalog. - Add `documented` and `maintenance` (active/maintained/deprecated/unknown) metadata to TemplateEntry, alongside existing verified/downloads. - Compute a 0-100 quality score blending verification, documentation, usage and maintenance state, plus human-readable trust badges. - Rank search results by quality score (downloads break ties) so trusted, well-documented and well-maintained templates surface first. - Show quality score, maintenance, documentation status and trust badges in `template list`, `search` and `show`. - Seed registry.json with the new metadata and document the feature. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…sig) Closes Nanle-code#217 Expand the built-in example templates with common real-world use cases so contributors can learn the system quickly and bootstrap useful contracts. - escrow: DeFi token escrow with buyer/seller/arbiter roles for marketplaces, freelance payments and OTC trades. - dao-governance: minimal DAO with member proposals and one-member-one-vote tallying. - multisig-vault: threshold (M-of-N) multi-signature vault for shared-custody token transfers and treasuries. Each template ships a Cargo.toml, documented src/lib.rs with unit tests, and a README with build/deploy/usage instructions, and uses the standard {{PROJECT_NAME}} placeholders. Registered in registry.json (builtin source, quality metadata) and listed in templates/README.md.
…lanations Closes Nanle-code#218 Make template discovery faster and results easier to scan. - Add relevance-based ranking: name matches outweigh tag matches, which outweigh description matches; exact/prefix name matches score highest. Results sort by relevance, then quality score, then downloads. - Add structured filters to `template search`: --tags (must have all), --verified, and --min-quality. Query is now optional ("" lists all). - Explain each result by reporting which fields matched and a relevance value, and summarize the active filters above the results. - Add SearchFilters/SearchResult/search_templates_ranked to the templates module; keep search_templates as a thin backwards-compatible wrapper. - Consolidate the duplicate search command handler into one implementation and document the new flags. Add unit tests for relevance scoring.
Closes Nanle-code#219 Make template installation clearer and recoverable. - Show each install step (fetch, validate, install) behind a spinner that resolves to a check mark on success. - Add a PathCleanup RAII guard that rolls back partially-written directories when any step fails, for both marketplace installs (staged temp dir + target dir) and the regular contract scaffold path. The staging temp dir is always cleaned up. - Surface actionable error messages explaining the failure and that the partial install was rolled back; the download-count update is now best-effort and never rolls back a successful install. - Add unit tests covering rollback-vs-commit behavior.
|
@manoahLinks Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
The repository had unresolved merge artifacts (duplicated functions, match arms, struct fields and imports) across several modules that prevented `cargo build`. Resolve them so the branch compiles and tests run. - Cargo.toml: remove duplicate `sha2` key; drop the unused `soroban-sdk` dependency (only referenced inside generated-template string literals), which also fixes an unresolvable `quote` version conflict with zxcvbn. - templates.rs: make `TemplateEntry.source` the `TemplateSource` enum (matches registry.json), delete the duplicate string/`serde_json::Value` variants of template_source_content/add_template/fetch_template/update_template, drop the unreachable tail in load_registry (now falls back to the bundled registry), and add a builtin-template fetch path. - new.rs: resolve duplicated dapp_main/dapp_package/scaffold_dapp; use enum source Display. - wallet.rs: fix interleaved Rotate/Export/Import match arms and the encrypt_secret arity. - tx.rs: remove duplicate TxFilter fields. network.rs: remove duplicate Add arm. deploy.rs: drop duplicate import line. main.rs: remove stray `mod info`. - crypto.rs: derive Debug on StrengthReport so its test compiles. Builds clean; 100/102 unit tests pass. The 2 remaining failures (deploy sha256 fixture, soroban event parsing) are pre-existing and unrelated to these conflicts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR bundles four related improvements to the template marketplace and scaffolding workflow.
Closes
#216 — Quality signals & trust indicators
documentedandmaintenance(active/maintained/deprecated/unknown) metadata toTemplateEntry.quality_score()blending verification, documentation, usage and maintenance, plustrust_indicators()badges.list/search/show.registry.jsonwith the new metadata.#217 — Real-world example templates
New built-in templates under
templates/examples/, each withCargo.toml, documentedsrc/lib.rs+ tests, and aREADME.md:escrow— DeFi buyer/seller/arbiter token escrow.dao-governance— member proposals with one-member-one-vote tallying.multisig-vault— threshold M-of-N shared-custody vault.Registered in
registry.jsonand listed intemplates/README.md.#218 — Search relevance & filtering
template search:--tags(must have all),--verified,--min-quality; query is now optional.searchcommand handler.#219 — Install progress & recovery
PathCleanupRAII guard rolls back partially-written directories on failure, for both marketplace installs and the regular contract scaffold path; staging temp dir is always cleaned up.Tests
Added unit tests for quality scoring/badges, relevance scoring, and install rollback-vs-commit behavior.