-
Notifications
You must be signed in to change notification settings - Fork 17
refactor(contracts): migrate to tsx and restructure registry generator #809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
36e04f7 to
9757261
Compare
| pull_request: | ||
| branches: | ||
| - develop | ||
| - development |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the development branch is being added, should the develop branch be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah bit weird, I agree. But we have to use a new name because in develop where recurrent DCO problems and was a last minute solution, kind of... So we leave the door open to go back to develop and by keeping both we make sure will not have to make any changes to this workflow later on.
9757261 to
c930d0a
Compare
Reorganize the monolithic registry generator into a well-structured module with clear separation of concerns: Core Components: - extractor.ts: Contract metadata extraction from artifacts - scanner.ts: Filesystem scanning and contract discovery - generator.ts: Code generation logic (formerly registryGenerator.ts) - pipeline.ts: Main generation orchestration - types.ts: Centralized type definitions Utilities: - abiExtractor: ABI parsing and extraction - fileUtils: File I/O operations - logging: Structured logging - solidityParser: Comprehensive Solidity parser avoiding TypeChain Benefits: - Eliminated 6+ second TypeChain import overhead - Improved maintainability with single-responsibility modules - Better testability with isolated concerns - Flexible caching support via --use-cache flag - New npm script: npm run generate:registry:cached Infrastructure: - Updated barrel exports (index.ts files) - Cleaned up atsRegistry.data.ts (removed unused exports) - Updated CLI entry point with improved argument parsing - Enhanced logging capabilities - Updated integration tests Removed: - Old generateRegistry.ts monolithic entry point - Duplicated operations from infrastructure layer Reorganized files: - scripts/tools/generators/registryGenerator.ts → registry-generator/core/generator.ts - scripts/infrastructure/operations/generateRegistryPipeline.ts → registry-generator/pipeline.ts Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
Migrate from ts-node with tsconfig-paths/register to tsx for faster, simpler TypeScript script execution. Remove redundant ts-node configuration from tsconfig.json since tsx handles path aliases natively. Changes: - packages/ats/contracts/package.json: Replace all ts-node invocations with tsx in CLI entry points (deploy*, upgrade*, generate:registry) - packages/ats/contracts/tsconfig.json: Remove ts-node configuration block - package.json: Add convenience scripts for contracts utilities exposed at root level (test:scripts:unit:parallel, test:scripts:integration:parallel, upgrade:previewnet, generate:registry, local:hardhat, size, slither, doc) Benefits: - Faster script execution with tsx (no tsconfig-paths dependency) - Simpler configuration (one less configuration block) - Better IDE integration and debugging support - Scripts available directly from monorepo root for convenience Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
c930d0a to
bde618b
Compare
The pre-push hook was incorrectly rejecting commits that had valid GPG signatures but whose public keys were not in the local keyring. This caused pushes to fail when rebasing from branches with commits signed by other team members. Changed from `git verify-commit` (requires public key) to `git log --format=%G?` which checks if a signature EXISTS without requiring verification. The hook now accepts any signature status except 'N' (no signature). Signed-off-by: Miguel Carpena <miguel.carpena@io.builders> Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
Description
This PR refactors the smart contracts build pipeline with two major improvements:
Migrate to tsx: Replaced ts-node with tsx for ~3x faster script execution. Removed redundant tsconfig-paths configuration and simplified TypeScript script handling with native path alias support.
Restructure registry generator: Reorganized the monolithic registry generator into a well-structured, modular architecture with clear separation of concerns:
Benefits
--use-cacheflag andnpm run generate:registry:cachedType of change
Testing
npm run ats:contracts:testto verify contract compilation and tests still passnpm run generate:registryto test registry generation pipelinenpm run test:scripts:unitto verify registry generator unit testsNode version:
Checklist