Skip to content

Commit

Permalink
Search for class names that extend any other classes (hotfix). (#637)
Browse files Browse the repository at this point in the history
  • Loading branch information
shimkiv authored May 7, 2024
1 parent abd215f commit 5a55881
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## Unreleased

## [0.20.2](https://github.com/o1-labs/zkapp-cli/compare/0.20.1...0.20.2) - 2024-05-07

### Fixed

- [Hotfix] SmartContract classes lookup for deployment. [#637](https://github.com/o1-labs/zkapp-cli/pull/637)

## [0.20.1](https://github.com/o1-labs/zkapp-cli/compare/0.20.0...0.20.1) - 2024-04-30

### Added
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zkapp-cli",
"version": "0.20.1",
"version": "0.20.2",
"description": "CLI to create zkApps (zero-knowledge apps) for Mina Protocol",
"homepage": "https://github.com/o1-labs/zkapp-cli/",
"keywords": [
Expand Down
6 changes: 4 additions & 2 deletions src/lib/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,9 +674,11 @@ export async function findSmartContracts(path) {

for (const file of files) {
const str = fs.readFileSync(file, 'utf-8');
let results = str.matchAll(/class (\w*) extends SmartContract/gi);
// TODO: Implement better SmartContract classes lookup.
// https://github.com/o1-labs/zkapp-cli/issues/636
let results = str.matchAll(/class (\w+) (extends|implements) (\w+)/gi);
results = Array.from(results) ?? []; // prevent error if no results
results = results.map((result) => result[1]); // only keep capture groups
results = results.map((result) => result[1]); // only keep first capture group, the class name
smartContracts.push(...results);
}
return smartContracts;
Expand Down

0 comments on commit 5a55881

Please sign in to comment.