loambuild / loam

build, deploy, and maintain ambitious smart contracts. monorepo for Loam SDK, CLI, and shared tools.
https://loam.build
2 stars 7 forks source link

Allow users to choose whether to overwrite their existing files with FE template files or not #123

Open elizabethengelman opened 4 months ago

elizabethengelman commented 4 months ago

This came from this conversation: https://github.com/loambuild/loam/pull/120#discussion_r1681790077

In stellar contract init we are currently ignoring the workspace Cargo.toml that is included in the frontend template. We also did not want to blindly overwrite the existing, base Cargo.toml file with the one from the template. This issue is proposing to update stellar contract init so that when a user passes in --frontend-template the CLI will give them an option for any conflicting files if they want to overwrite them with the FE template version or not.

The main motivation for this change is so that loam init can expect that the workspace Cargo.toml file that is in the loam frontend template is the one that will be used. The current stellar contract init implementation does not include the frontend template's Cargo.toml file. We had to do some workaround to replace soroban-sdk with loam-sdk and add loam-subcontract-core in https://github.com/loambuild/loam/pull/120/files so that loam init could use soroban contract init under the hood, and still work in creating a loam project.