ethershell 0.1.1-beta.0 → 0.1.2-beta.0
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.
- package/README.md +2 -2
- package/package.json +1 -1
- package/src/utils/dir.js +10 -0
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ An interactive Node.js console for Ethereum smart contract development. Write, c
|
|
|
35
35
|
# Install globally:
|
|
36
36
|
npm i -g ethershell
|
|
37
37
|
|
|
38
|
-
# Start EtherShell:
|
|
38
|
+
# Start EtherShell in the root directory of your project:
|
|
39
39
|
ethershell
|
|
40
40
|
|
|
41
41
|
#or
|
|
@@ -46,7 +46,7 @@ npx ethershell
|
|
|
46
46
|
### Basic Usage
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
# Start the console
|
|
49
|
+
# Start the console in the root directory of your project:
|
|
50
50
|
ethershell
|
|
51
51
|
|
|
52
52
|
# You should see:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ethershell",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2-beta.0",
|
|
5
5
|
"description": "Interactive JavaScript console for Ethereum smart contract management",
|
|
6
6
|
"author": "Alireza Kiakojouri (alirezaethdev@gmail.com)",
|
|
7
7
|
"repository": {
|
package/src/utils/dir.js
CHANGED
|
@@ -57,6 +57,16 @@ export function collectSolFiles(dirPath) {
|
|
|
57
57
|
*/
|
|
58
58
|
export function findImports(importPath, basePath) {
|
|
59
59
|
try {
|
|
60
|
+
// Handle node_modules imports (e.g., @openzeppelin/contracts/...)
|
|
61
|
+
if (importPath.startsWith('@')) {
|
|
62
|
+
const nodeModulesPath = path.resolve(process.cwd(), 'node_modules', importPath);
|
|
63
|
+
|
|
64
|
+
if (fs.existsSync(nodeModulesPath)) {
|
|
65
|
+
const content = fs.readFileSync(nodeModulesPath, 'utf8');
|
|
66
|
+
return { contents: content };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
60
70
|
// Resolve relative to the current file's directory
|
|
61
71
|
const resolvedPath = path.resolve(basePath, importPath);
|
|
62
72
|
|