Skip to content
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

feat: enable pop up without project type specification #403

Merged
merged 16 commits into from
Feb 17, 2025
Merged

Conversation

AlexD10S
Copy link
Collaborator

@AlexD10S AlexD10S commented Feb 6, 2025

  • Enables pop up command to run without specifying contract or parachain, automatically detecting the project type.

  • Handles the deprecation of pop up contract and pop up parachain, keeping them functional for now but marking them for future removal (Reference feat: enable building without project type specification #222).

  • Refactors pop up to distinguish between deploying a parachain and launching a local network.

    • pop up parachain is now migrated to pop up network.
    • pop up in a parachain template will deploy a parachain instead of launching a network.
      Note:: Currently, running pop up inside a parachain project does nothing. The deployment logic for parachains has been removed in this commit 38a19a8 and will be implemented separately in an upcoming PR feat: deploy parachain #404.

Commands for testing

# Deploy a contract passing path
pop up ../flipper --args false
# Deploy a contract using flag --path
pop up --path ../flipper --args false
# Deploy a contract, inside the contract folder.
pop up --args false
# Deploy a contract with deprecated command. (Should display an warning message).
pop up contract --args false
# Launch a local network
pop up network -f ./network.toml
# Launch a local network  with deprecated command. (Should display an warning message).
pop up parachain -f ./network.toml

# This will be used to deploy a parachain; currently, not implemented, only shows a warning.
pop up

[sc-2506]

Copy link

codecov bot commented Feb 7, 2025

Codecov Report

Attention: Patch coverage is 62.50000% with 42 lines in your changes missing coverage. Please review.

Project coverage is 75.34%. Comparing base (2e03233) to head (4913c92).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
crates/pop-cli/src/commands/up/mod.rs 78.26% 3 Missing and 12 partials ⚠️
crates/pop-cli/src/commands/up/contract.rs 40.00% 11 Missing and 1 partial ⚠️
crates/pop-cli/src/commands/mod.rs 47.05% 9 Missing ⚠️
crates/pop-cli/src/commands/up/network.rs 0.00% 6 Missing ⚠️
@@            Coverage Diff             @@
##             main     #403      +/-   ##
==========================================
+ Coverage   75.11%   75.34%   +0.22%     
==========================================
  Files          63       64       +1     
  Lines       13842    13973     +131     
  Branches    13842    13973     +131     
==========================================
+ Hits        10398    10528     +130     
+ Misses       2118     2098      -20     
- Partials     1326     1347      +21     
Files with missing lines Coverage Δ
crates/pop-cli/src/commands/up/network.rs 6.84% <0.00%> (ø)
crates/pop-cli/src/commands/mod.rs 25.00% <47.05%> (+8.67%) ⬆️
crates/pop-cli/src/commands/up/contract.rs 40.95% <40.00%> (+6.87%) ⬆️
crates/pop-cli/src/commands/up/mod.rs 78.26% <78.26%> (ø)

... and 3 files with indirect coverage changes

@AlexD10S AlexD10S changed the base branch from feat/deploy-parachain to main February 9, 2025 10:56
@AlexD10S AlexD10S changed the title refactor: pop up command feat: enable pop up without project type specification Feb 9, 2025
@AlexD10S AlexD10S marked this pull request as ready for review February 9, 2025 11:18
Copy link
Collaborator

@chungquantin chungquantin left a comment

Choose a reason for hiding this comment

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

PR looks great! I left some comments mainly for the code improvement. Some based on my personal preferences. Not a blocker though.

@chungquantin
Copy link
Collaborator

base-parachain on  pr/53 [$?] via 🦀 1.81.0
➜ pop up
▲  No contract detected. Ensure you are in a valid project directory.

Currently, if running pop up inside the parachain it throws the error contract. Based on the PR description, I assume you are already aware of it? If so, everything looks good to me and I am happy to approve.

@AlexD10S
Copy link
Collaborator Author

base-parachain on  pr/53 [$?] via 🦀 1.81.0
➜ pop up
▲  No contract detected. Ensure you are in a valid project directory.

Currently, if running pop up inside the parachain it throws the error contract. Based on the PR description, I assume you are already aware of it? If so, everything looks good to me and I am happy to approve.

Yes, the pop up in the parachain folder is addressed in this PR: #404. To launch the local network, you can use either the new pop up network or the existing (deprecated) pop up parachain.

Copy link
Collaborator

@chungquantin chungquantin 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 68ec6d5 into main Feb 17, 2025
19 of 20 checks passed
@AlexD10S AlexD10S deleted the refactor/pop-up branch February 17, 2025 12:08
Copy link
Collaborator

@Daanvdplas Daanvdplas left a comment

Choose a reason for hiding this comment

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

Looking good, left a few nitpicks

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.

3 participants