-
Notifications
You must be signed in to change notification settings - Fork 11
Create fileManager for Temporary Project Setup [backend] #26
Copy link
Copy link
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
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
Type
Fields
Give feedbackNo fields configured for issues without a type.
📁 Create fileManager for Temporary Project Setup 🗄
📝 Description
Develop a
fileManagerutility to create and clean up temporary Rust projects for compilation and testing. This utility will generate aCargo.tomlandsrc/lib.rsin 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
apps/backend/src/utils/apps/backend/src/utils/fileManager.ts✅ Requirements
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.fs.promisesfor asynchronous file operations.Cargo.tomlwithsoroban-sdk = "21.2.0".tempDiris unique (e.g.,temp/project_${Date.now()}).feat: create file manager utility.🏆 Expected Outcomes
fileManagercreates temporary Rust projects with correctCargo.tomlandsrc/lib.rs.🔗 References
📋 Notes
sanitize-filename(from a later issue) for safe directory names.