-
Notifications
You must be signed in to change notification settings - Fork 40
feat: scaffold UI templates #676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5aeeb0c to
83d3eef
Compare
There was a problem hiding this 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
FrontendTypeandFrontendTemplateenums to represent and configure frontend templates - Adds
--with-frontendflag to contract and chain creation commands with interactive template selection - Extends
pop upcommand 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.
d57046e to
c740422
Compare
fc8643f to
37eff52
Compare
b3c51da to
6506fc4
Compare
|
Just finished the review! Spotted minor stuff and the vast majority of the logic looks good! Excellent job! |
5163841 to
877517f
Compare
877517f to
abecb14
Compare
moliholy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Closes #663
New flag
--with-frontendinpop newthat 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
It prompts the user to install the needed dependencies if not installed: A version >= 20 of
node&bunfor inkathon.It also also includes
--frontendinpop installto cover the installation of these dependencies:And it provides with a command to easily start the frontend dev server:
Ideally,
pop upwould 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:
create-inkathon-app@latestscio-labs/inkathon#88