{"id":47115452,"url":"https://github.com/pulseengine/bazel-file-ops-component","last_synced_at":"2026-03-12T18:58:27.364Z","repository":{"id":311296895,"uuid":"1043092001","full_name":"pulseengine/bazel-file-ops-component","owner":"pulseengine","description":"Universal file operations for Bazel build systems via WebAssembly components","archived":false,"fork":false,"pushed_at":"2026-03-01T13:05:17.000Z","size":2229,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-01T16:47:16.813Z","etag":null,"topics":["bazel","file-operations","pulseengine","webassembly"],"latest_commit_sha":null,"homepage":null,"language":"MDX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pulseengine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-23T05:55:54.000Z","updated_at":"2026-03-01T13:05:20.000Z","dependencies_parsed_at":"2025-08-24T04:16:21.820Z","dependency_job_id":"76b7b36d-6d95-4361-9bb5-f652f8e5c48a","html_url":"https://github.com/pulseengine/bazel-file-ops-component","commit_stats":null,"previous_names":["pulseengine/bazel-file-ops-component"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/pulseengine/bazel-file-ops-component","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Fbazel-file-ops-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Fbazel-file-ops-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Fbazel-file-ops-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Fbazel-file-ops-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pulseengine","download_url":"https://codeload.github.com/pulseengine/bazel-file-ops-component/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Fbazel-file-ops-component/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30439122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bazel","file-operations","pulseengine","webassembly"],"created_at":"2026-03-12T18:58:26.724Z","updated_at":"2026-03-12T18:58:27.358Z","avatar_url":"https://github.com/pulseengine.png","language":"MDX","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# bazel-file-ops-component\n\n\u003csup\u003eUniversal file operations for Bazel via WebAssembly components\u003c/sup\u003e\n\n\u0026nbsp;\n\n![Bazel](https://img.shields.io/badge/Bazel-43A047?style=flat-square\u0026logo=bazel\u0026logoColor=white\u0026labelColor=1a1b27)\n![WebAssembly](https://img.shields.io/badge/WebAssembly-654FF0?style=flat-square\u0026logo=webassembly\u0026logoColor=white\u0026labelColor=1a1b27)\n![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue?style=flat-square\u0026labelColor=1a1b27)\n\n\u003c/div\u003e\n\n\u0026nbsp;\n\n\u003e [!NOTE]\n\u003e Part of the PulseEngine toolchain. Provides sandboxed file operations for Bazel builds across all platforms.\n\n## Overview\n\nThis repository provides WebAssembly components for secure, cross-platform file operations in Bazel build systems. It replaces shell scripts and platform-specific file operations with sandboxed WebAssembly components that work consistently across Linux, macOS, and Windows.\n\n## Key Features\n\n- **Enhanced Security**: WebAssembly sandboxing with wasmtime preopen directories\n- **Cross-Platform**: Works identically on Linux, macOS, and Windows\n- **Dual Implementation**: Choose between TinyGo (security-focused) and Rust (performance-optimized)\n- **Backward Compatible**: Supports existing JSON batch processing workflows\n- **Individual Operations**: Direct function calls via WIT interface\n- **Build System Integration**: Easy integration with any Bazel rule set\n\n## Quick Start\n\n### Installation\n\nAdd to your `MODULE.bazel`:\n\n```starlark\nbazel_dep(name = \"bazel-file-ops-component\", version = \"0.1.0\")\n```\n\n### Basic Usage\n\n```starlark\nload(\"@bazel_file_ops_component//toolchain:defs.bzl\", \"file_ops_action\")\n\n# Simple file copying with TinyGo component (high security)\nfile_ops_action(\n    name = \"copy_sources\",\n    implementation = \"tinygo\",\n    operation = \"copy_file\",\n    src = \"source.cpp\",\n    dest = \"workspace/source.cpp\",\n)\n\n# Batch operations with JSON config (backward compatibility)\nfile_ops_action(\n    name = \"setup_workspace\",\n    implementation = \"auto\",\n    config = \"workspace_config.json\",\n    security_level = \"high\",\n)\n```\n\n### JSON Configuration (Backward Compatible)\n\n```json\n{\n  \"workspace_dir\": \"/build/workspace\",\n  \"operations\": [\n    {\"type\": \"copy_file\", \"src_path\": \"/src/main.cpp\", \"dest_path\": \"main.cpp\"},\n    {\"type\": \"mkdir\", \"path\": \"include/foundation\"},\n    {\"type\": \"copy_directory_contents\", \"src_path\": \"/headers\", \"dest_path\": \"include\"}\n  ]\n}\n```\n\n## Architecture\n\n### Dual Implementation Strategy\n\n| Implementation | Best For | Security | Performance | Use Cases |\n|---------------|----------|----------|-------------|-----------|\n| **TinyGo** | Security-critical operations | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | Cross-package headers, sensitive file ops |\n| **Rust** | Performance-critical operations | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | Large file operations, bulk processing |\n\n### Security Model\n\n- **WASM Sandboxing**: Components run in isolated WebAssembly environment\n- **Preopen Directories**: Only specified directories are accessible\n- **Capability-Based Security**: No access outside designated paths\n- **Path Validation**: Runtime validation against traversal attacks\n\n## Implementation Selection\n\n### Automatic Selection\n\n```starlark\nfile_ops_action(\n    implementation = \"auto\",  # Chooses best implementation based on operation\n    security_level = \"high\",   # Influences selection criteria\n)\n```\n\n### Manual Selection\n\n```starlark\n# High security operations\nfile_ops_action(implementation = \"tinygo\", security_level = \"strict\")\n\n# Performance critical operations\nfile_ops_action(implementation = \"rust\", security_level = \"standard\")\n```\n\n## Integration Examples\n\n### With rules_rust\n\n```starlark\nrust_wasm_component_library(\n    name = \"my_component\",\n    srcs = [\"src/lib.rs\"],\n    deps = [\"@crates//:dep\"],\n    workspace_preparation = \"@bazel_file_ops_component//:file_ops_component\",\n)\n```\n\n### With rules_go\n\n```starlark\ngo_wasm_component_library(\n    name = \"my_component\",\n    srcs = [\"main.go\"],\n    workspace_preparation = \"@bazel_file_ops_component//:file_ops_component\",\n)\n```\n\n### With rules_cc\n\n```starlark\ncc_wasm_component_library(\n    name = \"my_component\",\n    srcs = [\"main.cpp\"],\n    hdrs = [\"include/header.h\"],\n    workspace_preparation = \"@bazel_file_ops_component//:file_ops_component\",\n)\n```\n\n## Documentation\n\n- **[📚 Full Documentation](https://bazel-file-ops.pulseengine.eu)** - Complete guide with examples\n- **[🏗️ Architecture Overview](https://bazel-file-ops.pulseengine.eu/architecture/overview)** - Technical architecture details\n- **[🔒 Security Model](https://bazel-file-ops.pulseengine.eu/security/wasm-sandbox)** - Security features and configuration\n- **[🚀 Integration Guide](https://bazel-file-ops.pulseengine.eu/integration/rules-wasm-component)** - Step-by-step integration\n- **[📖 API Reference](https://bazel-file-ops.pulseengine.eu/reference/wit-interface)** - Complete WIT interface documentation\n\n## Supported Operations\n\n### Individual Operations\n\n- `copy-file`: Copy single files with permissions\n- `copy-directory`: Recursive directory copying\n- `create-directory`: Safe directory creation\n- `path-exists`: Path existence and type checking\n- `validate-path`: Security validation\n- `list-directory`: Directory listing with patterns\n\n### Batch Operations\n\n- `prepare-workspace`: Complete workspace setup\n- `process-json-config`: JSON batch processing (backward compatibility)\n- `setup-cpp-workspace`: C/C++ specific workspace preparation\n- `setup-go-module`: Go/TinyGo module organization\n\n## Security Configuration\n\n### Security Levels\n\n```starlark\n# Standard: Basic path validation\nfile_ops_action(security_level = \"standard\")\n\n# High: Strict validation + preopen directories\nfile_ops_action(security_level = \"high\")\n\n# Strict: Maximum restrictions + minimal access\nfile_ops_action(security_level = \"strict\")\n```\n\n### Preopen Directory Configuration\n\n```starlark\nfile_ops_action(\n    security_config = {\n        \"allowed_dirs\": [\"/workspace\", \"/tmp/build\"],\n        \"denied_patterns\": [\"../*\", \"/*.secret\"],\n        \"enforce_validation\": True,\n    }\n)\n```\n\n## Performance\n\n| Operation | TinyGo Component | Rust Component | Native Binary |\n|-----------|------------------|----------------|---------------|\n| Single file copy | ~2ms overhead | ~1ms overhead | Baseline |\n| Directory copy (100 files) | ~15ms overhead | ~8ms overhead | Baseline |\n| Workspace setup | ~25ms overhead | ~12ms overhead | Baseline |\n\n*Overhead measurements include WASM runtime initialization and security validation*\n\n## Development\n\n### Building Components\n\n```bash\n# Build TinyGo component\nbazel build //tinygo:file_ops_component --config=tinygo\n\n# Build Rust component\nbazel build //rust:file_ops_component --config=rust-wasm\n\n# Build both components\nbazel build //... --config=wasm\n```\n\n### Running Tests\n\n```bash\n# Run all tests\nbazel test //...\n\n# Test specific implementation\nbazel test //tinygo:all\nbazel test //rust:all\n\n# Integration tests\nbazel test //tests/integration:all\n```\n\n### Documentation Development\n\n```bash\n# Start development server\nbazel run //docs-site:dev\n\n# Build documentation\nbazel build //docs-site:build\n\n# Deploy documentation\nbazel run //docs-site:deploy\n```\n\n## Contributing\n\nWe welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n### Development Setup\n\n```bash\n# Clone repository\ngit clone https://github.com/pulseengine/bazel-file-ops-component.git\ncd bazel-file-ops-component\n\n# Run setup script\n./scripts/setup-dev.sh\n\n# Verify setup\nbazel build //... --config=dev\nbazel test //... --config=dev\n```\n\n## Ecosystem Integration\n\nThis component is designed for use across the Bazel ecosystem:\n\n- **[rules_wasm_component](https://github.com/pulseengine/rules_wasm_component)** - Primary integration\n- **rules_rust** - Rust component builds\n- **rules_go** - Go component builds\n- **rules_cc** - C++ component builds\n- **rules_js** - JavaScript component builds\n\n## License\n\nLicensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for details.\n\n## Support\n\n- **GitHub Issues**: [Report bugs and request features](https://github.com/pulseengine/bazel-file-ops-component/issues)\n- **Discussions**: [Community discussions](https://github.com/pulseengine/bazel-file-ops-component/discussions)\n- **Documentation**: [Full documentation site](https://bazel-file-ops.pulseengine.eu)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n\u003csub\u003ePart of \u003ca href=\"https://github.com/pulseengine\"\u003ePulseEngine\u003c/a\u003e \u0026mdash; formally verified WebAssembly toolchain for safety-critical systems\u003c/sub\u003e\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulseengine%2Fbazel-file-ops-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpulseengine%2Fbazel-file-ops-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulseengine%2Fbazel-file-ops-component/lists"}