You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to propose several enhancements to the Scrypto CLI to improve the development experience, especially for tasks such as compiling, testing, and managing dependencies. Drawing inspiration from the fast and efficient workflow provided by tools like Forge/Foundry in Solidity development, the following features are suggested to streamline and speed up the development process in Scrypto:
Proposed Features
Conditional Compilation and Testing
Feature: Implement a mechanism where scrypto test only recompiles if changes have been made since the last compilation.
Benefit: Saves time by avoiding unnecessary recompilation and allows developers to quickly run tests.
Incremental Compilation
Feature: Ensure incremental compilation is enabled by default for development builds.
Benefit: Significantly reduces compilation times for incremental changes, enhancing the iterative development process.
Parallel Testing
Feature: Enable parallel test execution by default.
Benefit: Speeds up the execution of the test suite, making the feedback loop faster for developers.
Custom CLI Options
Feature: Add CLI options for fast compilation and clean recompilation. For example:
--fast: Perform a fast compilation optimized for development speed.
--clean: Clean the build directory and recompile everything.
Benefit: Provides flexibility to developers to choose between fast iterative builds and complete clean builds.
Automatic Change Detection with cargo watch Integration
Feature: Integrate cargo watch to automatically run checks, builds, or tests when files change.
Benefit: Provides instant feedback to developers, similar to hot-reload in other development environments.
Optimized Development Profile
Feature: Define and use a custom profile for faster builds during development.
Benefit: Allows for quicker builds without sacrificing essential debugging capabilities.
Improved Build Scripts
Feature: Provide a set of build scripts (e.g., Bash scripts or Makefiles) to handle common tasks such as conditional compilation, testing, and cleaning.
Benefit: Streamlines common development tasks and reduces the overhead of manually managing build commands.
Example Custom CLI Script
#!/bin/bash# Function to compile in development modefast_compile() {
echo"Performing fast compilation..."
cargo build --profile dev
}
# Function to run testsrun_tests() {
echo"Running tests..."
cargo test
}
# Function to check for changescheck_for_changes() {
echo"Checking for changes..."if cargo check;thenecho"No changes detected."return 0
elseecho"Changes detected."return 1
fi
}
# Function to clean and recompileclean_and_compile() {
echo"Cleaning and recompiling..."
cargo clean
cargo build
}
# Parse CLI argumentswhile [[ "$#"-gt 0 ]];docase$1in
--fast) fast=1 ;;
--clean) clean=1 ;;
*) echo"Unknown parameter passed: $1";exit 1 ;;
esacshiftdone# Check for changes and act accordinglyif check_for_changes;then
run_tests
elseif [[ $clean-eq 1 ]];then
clean_and_compile
elif [[ $fast-eq 1 ]];then
fast_compile
else
cargo build
fi
run_tests
fi
NOTE: I don't have much Rust experience so GPT4 helped me draft.
The text was updated successfully, but these errors were encountered:
Description
I would like to propose several enhancements to the Scrypto CLI to improve the development experience, especially for tasks such as compiling, testing, and managing dependencies. Drawing inspiration from the fast and efficient workflow provided by tools like Forge/Foundry in Solidity development, the following features are suggested to streamline and speed up the development process in Scrypto:
Proposed Features
Conditional Compilation and Testing
scrypto test
only recompiles if changes have been made since the last compilation.Incremental Compilation
Parallel Testing
Custom CLI Options
--fast
: Perform a fast compilation optimized for development speed.--clean
: Clean the build directory and recompile everything.Automatic Change Detection with
cargo watch
Integrationcargo watch
to automatically run checks, builds, or tests when files change.Optimized Development Profile
Improved Build Scripts
Example Custom CLI Script
NOTE: I don't have much Rust experience so GPT4 helped me draft.
The text was updated successfully, but these errors were encountered: