-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Labels
backendIssues for the development of the backend of the online soroban compilerIssues for the development of the backend of the online soroban compilerenhancementNew feature or requestNew feature or requestexpressjsIssues related to the application backend and the Express js frameworkIssues related to the application backend and the Express js framework
Milestone
Description
📁 Create fileManager for Temporary Project Setup 🗄
📝 Description
Develop a fileManager utility to create and clean up temporary Rust projects for compilation and testing. This utility will generate a Cargo.toml and src/lib.rs in a temporary directory, ensuring each request is isolated. It will also handle cleanup to prevent disk space issues. This modular approach enhances maintainability and supports secure execution by isolating user code.
🎯 Objective
Create a TypeScript utility in apps/backend/src/utils/ to manage temporary Rust project directories and files.
🗂 Structure
- Directory:
apps/backend/src/utils/ - Files:
apps/backend/src/utils/fileManager.ts
- Expected structure:
apps/backend/ ├── src/ │ ├── utils/ │ │ └── fileManager.ts
✅ Requirements
- Create
fileManager.tswith two functions:setupProject(tempDir: string, code: string): Promise<void>: Creates a Rust project withCargo.tomlandsrc/lib.rs.cleanupProject(tempDir: string): Promise<void>: Deletes the temporary directory.
- Use
fs.promisesfor asynchronous file operations. - Include a default
Cargo.tomlwithsoroban-sdk = "21.2.0". - Ensure
tempDiris unique (e.g.,temp/project_${Date.now()}). - Test file creation and cleanup with a sample directory.
- Commit changes with a message like
feat: create file manager utility. - Push changes to the GitHub repository.
🏆 Expected Outcomes
fileManagercreates temporary Rust projects with correctCargo.tomlandsrc/lib.rs.- Cleanup function deletes directories without errors.
- Utility is reusable and handles errors gracefully.
- Changes are committed and pushed to GitHub.
🔗 References
📋 Notes
- Use
sanitize-filename(from a later issue) for safe directory names. - Ensure cleanup is idempotent to handle partial failures.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
backendIssues for the development of the backend of the online soroban compilerIssues for the development of the backend of the online soroban compilerenhancementNew feature or requestNew feature or requestexpressjsIssues related to the application backend and the Express js frameworkIssues related to the application backend and the Express js framework