recon-generate 0.0.32 → 0.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,7 +19,7 @@ import {vm} from "@chimera/Hevm.sol";
19
19
  // Helpers
20
20
  import {Panic} from "@recon/Panic.sol";
21
21
  {{#each extraImports}}
22
- import "{{this}}";
22
+ import { {{this.name}} } from "{{this.path}}";
23
23
  {{/each}}
24
24
 
25
25
  abstract contract AdminTargets is
@@ -21,7 +21,7 @@ import {Panic} from "@recon/Panic.sol";
21
21
 
22
22
  {{#if path}}import "{{path}}";{{/if}}
23
23
  {{#each extraImports}}
24
- import "{{this}}";
24
+ import { {{this.name}} } from "{{this.path}}";
25
25
  {{/each}}
26
26
 
27
27
  abstract contract {{pascal contractName}}Targets is
package/dist/utils.d.ts CHANGED
@@ -91,9 +91,13 @@ export interface SymbolsInfo {
91
91
  * - definedIn: symbol name → file path where it's actually defined (top-level definitions)
92
92
  */
93
93
  export declare function buildExportedSymbolsMap(buildOutput: any): SymbolsInfo;
94
+ export interface ExtraImport {
95
+ name: string;
96
+ path: string;
97
+ }
94
98
  /**
95
99
  * Given imported file paths, function definitions, and symbol maps, returns a list of
96
- * extra import paths needed for types referenced in function parameters but not available
100
+ * named imports needed for types referenced in function parameters but not available
97
101
  * through already-imported files.
98
102
  */
99
- export declare function resolveExtraImports(importedPaths: string[], functions: FunctionDefinitionParams[], symbolsInfo: SymbolsInfo): string[];
103
+ export declare function resolveExtraImports(importedPaths: string[], functions: FunctionDefinitionParams[], symbolsInfo: SymbolsInfo): ExtraImport[];
package/dist/utils.js CHANGED
@@ -647,7 +647,7 @@ function buildExportedSymbolsMap(buildOutput) {
647
647
  }
648
648
  /**
649
649
  * Given imported file paths, function definitions, and symbol maps, returns a list of
650
- * extra import paths needed for types referenced in function parameters but not available
650
+ * named imports needed for types referenced in function parameters but not available
651
651
  * through already-imported files.
652
652
  */
653
653
  function resolveExtraImports(importedPaths, functions, symbolsInfo) {
@@ -673,14 +673,16 @@ function resolveExtraImports(importedPaths, functions, symbolsInfo) {
673
673
  }
674
674
  }
675
675
  // For each referenced type not available, find its definition file
676
- const extraPaths = new Set();
677
- for (const typeName of referenced) {
676
+ const results = [];
677
+ const seen = new Set();
678
+ for (const typeName of Array.from(referenced).sort()) {
678
679
  if (available.has(typeName))
679
680
  continue;
680
681
  const defFile = symbolsInfo.definedIn.get(typeName);
681
- if (defFile) {
682
- extraPaths.add(defFile);
682
+ if (defFile && !seen.has(typeName)) {
683
+ seen.add(typeName);
684
+ results.push({ name: typeName, path: defFile });
683
685
  }
684
686
  }
685
- return Array.from(extraPaths).sort();
687
+ return results;
686
688
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recon-generate",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "description": "CLI to scaffold Recon fuzzing suite inside Foundry projects",
5
5
  "main": "dist/index.js",
6
6
  "bin": {