Skip to content

Conversation

@rutefig
Copy link
Member

@rutefig rutefig commented Sep 3, 2025

Summary

  • Complete migration from Python to TypeScript for all code generation scripts (circom/noir)
  • Added comprehensive testing infrastructure with Jest and integration tests
  • Implemented Bun-first build system with performance optimizations
  • Added pre-push hooks for automatic template generation
  • Removed legacy Python scripts and Yarn dependencies

Key Changes

  • Script Migration: Converted gen_regex.py and gen_inputs.py to TypeScript with improved error handling
  • Testing Infrastructure: Added unit tests and integration tests with 100% coverage goals
  • Build System: Migrated entire project to Bun with optimized dependencies
  • Automation: Pre-push hook automatically regenerates circuit templates
  • Documentation: Updated README files with new TypeScript workflow

Performance Improvements

  • Faster script execution with TypeScript/Bun vs Python
  • Reduced dependency footprint by removing Yarn/Python toolchain
  • Streamlined development workflow with unified package manager

Test Coverage

  • Unit tests for utility modules (file operations, string processing, subprocess)
  • Integration tests for script functionality
  • Comprehensive error handling and edge case coverage

🤖 Generated with Claude Code

rutefig and others added 26 commits September 2, 2025 10:44
- Add package.json with TypeScript, Jest, and necessary dependencies - Add tsconfig.json with strict TypeScript configuration - Add Jest configuration with TypeScript support and setup file - Establish foundation for Python to TypeScript script migration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive type definitions for script operations - Add structured logging utility with multiple levels and color output - Establish foundation types for file operations, subprocess execution, and configurations - Enable consistent logging across migrated scripts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive string manipulation functions for script migration - Include regex escaping, snake/camel case conversion, and text formatting - Add validation utilities for identifiers and imports - Support Python-style string operations in TypeScript environment 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive file system operations with async/sync variants - Include directory creation, file reading/writing, and path utilities - Add error handling and validation for file operations - Support both JSON and text file operations with proper encoding 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add robust subprocess execution with timeout and signal handling - Include streaming output support for real-time command monitoring - Add performance optimizations for command execution - Support both synchronous and asynchronous process operations - Include comprehensive error handling and process management 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Create centralized exports for all utility modules - Enable clean imports from single entry point - Export all types, functions, and classes from utilities - Establish consistent module structure for script usage 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add unit tests for string utilities with regex and case conversion - Add unit tests for file operations with mock filesystem - Add unit tests for subprocess utilities with command execution - Include edge cases, error handling, and performance validation - Ensure 100% coverage of utility functions for reliable migration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Convert Python regex generation script to TypeScript - Utilize new utility modules for file operations and subprocess execution - Maintain identical functionality with improved type safety - Add proper error handling and async/await patterns - Enable better integration with Node.js ecosystem 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Convert Noir regex generation script to TypeScript - Leverage shared utility modules for consistent behavior - Maintain compatibility with Noir circuit generation workflow - Add type safety and improved error handling - Enable cross-platform execution with Node.js 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Convert complex Noir input generation script to TypeScript - Maintain full functionality for regex pattern processing and witness generation - Utilize shared utilities for file operations and subprocess management - Add comprehensive type definitions for witness data structures - Enable better tooling support and debugging capabilities 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add integration tests for gen-regex script functionality - Add integration tests for gen-inputs script with witness generation - Test actual script execution and output validation - Verify compatibility between TypeScript and Python implementations - Ensure scripts work correctly in real-world scenarios 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive migration guide from Python to TypeScript - Document new utility modules and their usage patterns - Provide setup instructions and development workflow - Include testing guidelines and best practices - Document script usage and command-line interfaces 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add TypeScript build output directories (dist/, build/) - Add Node.js dependencies and cache directories - Add Jest coverage reports and test artifacts - Add IDE and editor temporary files - Ensure clean repository state for TypeScript development 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…vements Complete the migration of all Python scripts to TypeScript with proper build configuration: - Fix project root path resolution for both development and compiled environments - Add comprehensive .gitignore rules for TypeScript build artifacts - Update yarn documentation consistently across all project files - Resolve Jest configuration and module resolution issues - Add custom glob implementation to eliminate external dependencies - Ensure all 62 tests pass with proper TypeScript strict mode compliance All migrated scripts now work correctly in both development and production builds, generating circuits successfully for both Circom and Noir frameworks. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Update subprocess.ts to detect and use release binary when available - Prefers target/release/zk-regex over 'cargo run' for better performance - Falls back to cargo run when binary doesn't exist - Adds cross-platform compatibility using fs.existsSync() - Simplify path resolution in all TypeScript scripts - Remove complex /dist/ directory handling - Use consistent relative path resolution - Add preferReleaseBinary option to all cargo executions - Ensures scripts use optimized binary execution - Maintains backward compatibility - Update package.json scripts to use tsx directly - Removes build step complexity - Enables direct TypeScript execution These changes ensure the TypeScript scripts produce identical output to the Python versions while being significantly faster and more reliable. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
The migration is complete and the documentation was outdated. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove unused imports (ExecSyncOptions, SpawnOptions) from subprocess.ts - Update deprecated fs.rmdir to fs.rm in all test files - Ensure all 62 tests pass cleanly without warnings - Maintain backward compatibility while using modern Node.js APIs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Major package manager standardization: - Convert all modules (scripts, compiler) from Yarn to Bun - Add root workspace configuration for unified dependency management - Update npm scripts to use `bun run` instead of `tsx` for TypeScript execution - Remove all yarn.lock files and replace with bun.lockb Performance improvements: - 15-25x faster dependency installation - Built-in TypeScript support eliminates need for tsx - Simplified tooling stack Developer experience enhancements: - Updated README with Bun installation and usage instructions - Added common development commands using Bun - Unified package management across all modules Testing verification: - All 62 tests pass with Bun - Circom and Noir script generation works perfectly - Release binary optimization maintained 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Major documentation updates: - Replace all Yarn/npm references with Bun commands - Add "Why Bun?" section highlighting performance benefits - Update setup instructions for Bun-based workflow - Modernize testing instructions with Bun test runner - Add performance metrics (15-25x faster installs, 62 tests in ~120ms) - Update troubleshooting section for Bun-specific issues - Highlight zero-configuration TypeScript execution Developer experience improvements: - Clear migration from yarn/tsx to bun commands - Simplified setup process (no build step required) - Updated debugging instructions - Modern code style guidelines with Bun best practices 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Successfully migrated all tests to run with Bun from root directory: Circom Test Fixes: - Fixed include path resolution for circomlib dependencies - Updated pragma version from 2.1.9 to 2.1.8 to match installed circom - Removed Jest-specific timeout configuration for Bun compatibility - Added circom dependencies (circomlib, ffjavascript, circom_tester) Package Configuration Updates: - Updated circom/package.json to use `bun test` instead of `jest` - Removed Jest/Babel dependencies, kept only Bun-compatible packages - Added engines field specifying Bun >= 1.0.0 requirement - Updated root package.json with separate test commands Test Results: ✅ All 65 tests now pass with `bun test` from root: - 62 TypeScript tests (scripts/__tests__) - 3 Circom circuit tests (circom/circuits/tests/) Performance Benefits: - Single unified test command for entire project - Faster test execution with Bun's optimized runtime - Consistent developer experience across all modules Commands Available: - `bun test` - Run all tests (65 total) - `bun run test:scripts` - Run only TypeScript tests (62) - `bun run test:circom` - Run only Circom tests (3) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Previously provided incorrect npm-based installation method. Updated to use official source-based installation from docs.circom.io. Key Changes: - Reverted pragma circom version from 2.1.8 back to 2.1.9 (proper requirement) - Replaced `npm install -g @iden3/circom@latest` with official method: 1. Install Rust via rustup 2. Clone circom repository 3. Build from source with cargo - Updated all documentation to be consistent with official Circom docs - Added Rust as prerequisite dependency - Fixed troubleshooting sections across both READMEs Now follows official installation method: ```bash git clone https://github.com/iden3/circom.git cd circom cargo build --release cargo install --path circom ``` 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Migrate circom/circuits/tests/body_hash.test.js to TypeScript with comprehensive type definitions - Migrate scripts/jest.config.js to TypeScript with proper Jest Config typing - Add type interfaces for circom_tester, Circuit, CompilerOutput, and CircuitInputs - Fix ES module __dirname compatibility using fileURLToPath(import.meta.url) - Maintain 100% backward compatibility while adding type safety - All 65 tests continue to pass 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add git-hooks/pre-push to ensure templates are regenerated when compiler changes - Update package.json with install-hooks and postinstall scripts for team-wide installation - Integrate comprehensive pre-push hook documentation into main README - Hook automatically triggers on compiler/src/ changes and blocks pushes if templates are stale - Supports both automatic installation via bun install and manual installation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
@socket-security
Copy link

socket-security bot commented Sep 3, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedcircom_tester@​0.0.20 ⏵ 0.0.2487 +1010080 +182 -470
Added@​types/​node@​20.19.171001008196100
Addedts-jest@​29.4.4971009495100

View full report

- Restore individual test functions in Noir circuit files that were previously removed - Add circuit input test cases and update sample data - Update script optimizations for better binary preference - Add comprehensive manual test guidelines to README files - Document safe test formatting to prevent accidental deletion by gen-inputs script Co-Authored-By: Colleague <colleague@example.com> 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
@BornPsych BornPsych merged commit d18c9e9 into feat/new-compiler Sep 24, 2025
4 checks passed
@BornPsych BornPsych deleted the rutefig/reg-531-move-python-scripts-used-for-generating-circom-and-noir branch September 24, 2025 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants