Skip to content

Conversation

@AlexD10S
Copy link
Collaborator

@AlexD10S AlexD10S commented Oct 16, 2025

Closes #663

New flag --with-frontend in pop new that supports frontend for contracts and chains. Currently it supports a curated set of community templates:
Contracts: inkathon, typink
Chain: create-dot-app

How to test

# Install with 
cargo install --git https://github.com/r0gue-io/pop-cli.git --branch  feat/scaffold-ui-templates --locked

# Interactive will prompt you for frontend template
pop new chain / pop new contract
# Or just CLI
pop new chain my-chain --with-frontend
pop new contract flipper --with-frontend
# To specify the template with the CLI
pop new chain my-chain --with-frontend=create-dot-app 
pop new contract flipper --with-frontend=typink

It prompts the user to install the needed dependencies if not installed: A version >= 20 of node & bun for inkathon.
It also also includes --frontend in pop install to cover the installation of these dependencies:

pop install -y --frontend

And it provides with a command to easily start the frontend dev server:

pop up frontend

Ideally, pop up would also spin up the local chain (or deploy the contract) and start the frontend dev server in one go. But that's trickier than it looks, because both spinning up the chain/contract and running the frontend are long-running processes that block indefinitely.

Future improvements:

@AlexD10S AlexD10S changed the title POC - feat: scaffold UI templates feat: scaffold UI templates Oct 20, 2025
@AlexD10S AlexD10S force-pushed the feat/scaffold-ui-templates branch from 5aeeb0c to 83d3eef Compare October 20, 2025 10:07
@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

❌ Patch coverage is 48.54167% with 247 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.49%. Comparing base (053942b) to head (f329d7a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/pop-cli/src/commands/install/frontend.rs 17.39% 76 Missing ⚠️
crates/pop-cli/src/commands/up/frontend.rs 54.54% 32 Missing and 13 partials ⚠️
crates/pop-cli/src/commands/new/frontend.rs 44.15% 40 Missing and 3 partials ⚠️
crates/pop-cli/src/commands/install/mod.rs 64.55% 22 Missing and 6 partials ⚠️
crates/pop-cli/src/commands/new/chain.rs 0.00% 28 Missing ⚠️
crates/pop-cli/src/commands/new/contract.rs 53.12% 10 Missing and 5 partials ⚠️
crates/pop-cli/src/commands/new/mod.rs 16.66% 5 Missing ⚠️
crates/pop-common/src/templates/frontend.rs 92.30% 5 Missing ⚠️
crates/pop-cli/src/commands/mod.rs 0.00% 1 Missing ⚠️
crates/pop-cli/src/commands/up/mod.rs 0.00% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main     #676      +/-   ##
==========================================
- Coverage   76.88%   76.49%   -0.39%     
==========================================
  Files         110      114       +4     
  Lines       25215    25614     +399     
  Branches    25215    25614     +399     
==========================================
+ Hits        19386    19593     +207     
- Misses       3764     3930     +166     
- Partials     2065     2091      +26     
Files with missing lines Coverage Δ
crates/pop-cli/src/common/binary.rs 72.65% <ø> (ø)
crates/pop-common/src/lib.rs 83.82% <ø> (ø)
crates/pop-common/src/templates/mod.rs 71.42% <ø> (ø)
crates/pop-cli/src/commands/mod.rs 68.68% <0.00%> (-0.35%) ⬇️
crates/pop-cli/src/commands/up/mod.rs 71.13% <0.00%> (-0.75%) ⬇️
crates/pop-cli/src/commands/new/mod.rs 77.94% <16.66%> (-4.60%) ⬇️
crates/pop-common/src/templates/frontend.rs 92.30% <92.30%> (ø)
crates/pop-cli/src/commands/new/contract.rs 74.50% <53.12%> (-3.41%) ⬇️
crates/pop-cli/src/commands/install/mod.rs 50.51% <64.55%> (+8.49%) ⬆️
crates/pop-cli/src/commands/new/chain.rs 47.54% <0.00%> (-2.93%) ⬇️
... and 3 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AlexD10S AlexD10S requested a review from Copilot October 23, 2025 08:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds frontend scaffolding capabilities to Pop CLI through a new --with-frontend flag for the pop new chain and pop new contract commands. The feature supports curated community templates for both contracts (inkathon, typink) and chains (create-polkadot-dapp, create-dot-app), and integrates frontend development server startup into the pop up command.

Key changes:

  • Introduces FrontendType and FrontendTemplate enums to represent and configure frontend templates
  • Adds --with-frontend flag to contract and chain creation commands with interactive template selection
  • Extends pop up command to automatically start frontend dev servers when a frontend directory is detected

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
crates/pop-common/src/templates/mod.rs Exports new frontend module
crates/pop-common/src/templates/frontend.rs Defines frontend template types and configuration
crates/pop-common/src/lib.rs Exports frontend types for public API
crates/pop-cli/src/common/binary.rs Extends feature flags to include contract features
crates/pop-cli/src/commands/up/network.rs Adds frontend server support to network command
crates/pop-cli/src/commands/up/mod.rs Adds frontend module and updates test defaults
crates/pop-cli/src/commands/up/frontend.rs Implements frontend directory resolution and server startup
crates/pop-cli/src/commands/up/contract.rs Adds frontend server support to contract deployment
crates/pop-cli/src/commands/new/mod.rs Updates command defaults with frontend flag
crates/pop-cli/src/commands/new/frontend.rs Implements frontend template selection and creation
crates/pop-cli/src/commands/new/contract.rs Integrates frontend scaffolding into contract creation
crates/pop-cli/src/commands/new/chain.rs Integrates frontend scaffolding into chain creation
crates/pop-cli/src/commands/install/mod.rs Exports new frontend installation module
crates/pop-cli/src/commands/install/frontend.rs Implements installation checks for Node, npx, and Bun

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@AlexD10S AlexD10S force-pushed the feat/scaffold-ui-templates branch from d57046e to c740422 Compare October 28, 2025 09:20
@AlexD10S AlexD10S force-pushed the feat/scaffold-ui-templates branch 2 times, most recently from fc8643f to 37eff52 Compare October 29, 2025 13:23
@AlexD10S AlexD10S marked this pull request as ready for review October 31, 2025 08:46
@AlexD10S AlexD10S force-pushed the feat/scaffold-ui-templates branch from b3c51da to 6506fc4 Compare October 31, 2025 13:29
@moliholy
Copy link
Collaborator

Just finished the review! Spotted minor stuff and the vast majority of the logic looks good! Excellent job!

@AlexD10S AlexD10S force-pushed the feat/scaffold-ui-templates branch from 5163841 to 877517f Compare November 11, 2025 08:52
@AlexD10S AlexD10S force-pushed the feat/scaffold-ui-templates branch from 877517f to abecb14 Compare November 11, 2025 09:20
@AlexD10S AlexD10S requested a review from moliholy November 11, 2025 14:11
Copy link
Collaborator

@moliholy moliholy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@AlexD10S AlexD10S merged commit db9a6d5 into main Nov 11, 2025
24 checks passed
@AlexD10S AlexD10S deleted the feat/scaffold-ui-templates branch November 11, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(pop new): scaffold UI templates

4 participants