@0xweb/hardhat 0.1.26 → 0.1.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.
- package/lib/index.js +26 -2
- package/package.json +2 -2
- package/readme.md +3 -3
package/lib/index.js
CHANGED
|
@@ -105,6 +105,30 @@ var $path;
|
|
|
105
105
|
return pathUtil.join(...paths).replace(/\\/g, '/');
|
|
106
106
|
}
|
|
107
107
|
$path.join = join;
|
|
108
|
+
function normalize(path) {
|
|
109
|
+
path = path
|
|
110
|
+
// Replace all / duplicates, but not near the protocol
|
|
111
|
+
.replace(/(?<![:/])\/{2,}/g, '/')
|
|
112
|
+
// Use forward slashes
|
|
113
|
+
.replace(/\\/g, '/')
|
|
114
|
+
// Replace "foo/./bar" with single slash: "foo/bar"
|
|
115
|
+
.replace(/\/\.\//g, '/');
|
|
116
|
+
while (true) {
|
|
117
|
+
let next = path.replace(/([^\/]+)\/\.\.\//g, (match, p1) => {
|
|
118
|
+
if (p1 !== '..' && p1 !== '.') {
|
|
119
|
+
return '';
|
|
120
|
+
}
|
|
121
|
+
return match;
|
|
122
|
+
});
|
|
123
|
+
if (next === path) {
|
|
124
|
+
// nothing to collapse
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
path = next;
|
|
128
|
+
}
|
|
129
|
+
return path;
|
|
130
|
+
}
|
|
131
|
+
$path.normalize = normalize;
|
|
108
132
|
})($path = exports.$path || (exports.$path = {}));
|
|
109
133
|
//# sourceMappingURL=$path.js.map
|
|
110
134
|
//# sourceMappingURL=$path.ts.map;
|
|
@@ -237,7 +261,7 @@ const taskArgsStore = { compileAll: false };
|
|
|
237
261
|
const app = new _0xweb_1.App();
|
|
238
262
|
await (0, alot_1.default)(contracts)
|
|
239
263
|
.forEachAsync(async (contract, i) => {
|
|
240
|
-
console.log(
|
|
264
|
+
console.log(`⏳ Generate ${contract.name}(${contract.path}) ${i}/${contracts.length}`);
|
|
241
265
|
const params = [
|
|
242
266
|
`install`, `${contract.path}`,
|
|
243
267
|
'--name', contract.name,
|
|
@@ -299,7 +323,7 @@ async function getCompiledAbis(config, compileSolOutput) {
|
|
|
299
323
|
return shouldInstall;
|
|
300
324
|
}
|
|
301
325
|
if (sources != null) {
|
|
302
|
-
return x.sourceFile.toLowerCase().startsWith(`file://${sources.toLowerCase()}`);
|
|
326
|
+
return _path_1.$path.normalize(x.sourceFile).toLowerCase().startsWith(`file://${_path_1.$path.normalize(sources).toLowerCase()}`);
|
|
303
327
|
}
|
|
304
328
|
return false;
|
|
305
329
|
})
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xweb/hardhat",
|
|
3
3
|
"description": "0xweb plugin for Hardhat",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.33",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Alex Kit",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
],
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"0xweb": "^0.
|
|
21
|
+
"0xweb": "^0.11.2",
|
|
22
22
|
"alot": "^0.3.0",
|
|
23
23
|
"atma-io": "^1.3.5",
|
|
24
24
|
"memd": "^0.3.10"
|
package/readme.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
----
|
|
5
|
-
[](https://badge.fury.io/js/@0xweb%2Fhardhat)
|
|
6
6
|
[](https://circleci.com/gh/0xweb-org/hardhat)
|
|
7
7
|
|
|
8
8
|
|
|
@@ -95,7 +95,7 @@ const text = await foo.name();
|
|
|
95
95
|
- `npx hardhat compile --sources /foo/bar/qux` - compiles solidity files which are located outside the `/contracts` folder
|
|
96
96
|
- `npx hardhat compile --artifacts /dist` - set custom folder for artifacts (ABI JSONs and TS contracts)
|
|
97
97
|
- `npx hardhat compile --watch` - Compile the sources and waits to recompile on changes
|
|
98
|
-
- `npx hardhat compile --tsgen false` - Do not generate the TS classes
|
|
99
98
|
- `npx hardhat compile --package path/to/package/folder` - You can split your project into packages, and with the command compile the contracts in a package, the sources will be searched in that directory, and the artifacts output will be written to that directory
|
|
100
|
-
|
|
99
|
+
- `npx hardhat compile --tsgen false` - Do not generate the TS classes. Installs all the contracts from the sources directory.
|
|
100
|
+
- `npx hardhat compile --install TimelockController` - Installs only specified Artifact name or *.sol paths. Comma separated.
|
|
101
101
|
----
|