@0xweb/hardhat 0.1.39 → 0.1.41
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/0xc/hardhat/Foo/Foo.ts +1 -1
- package/cache/solidity-files-cache.json +1 -1
- package/coverage/report/coverage/Foo.sol.html +1 -1
- package/coverage/report/coverage/index.html +1 -1
- package/coverage/report/index.html +1 -1
- package/coverage/report/lcov-report/coverage/Foo.sol.html +1 -1
- package/coverage/report/lcov-report/coverage/index.html +1 -1
- package/coverage/report/lcov-report/index.html +1 -1
- package/lib/index.js +25 -26
- package/package.json +1 -1
package/0xc/hardhat/Foo/Foo.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"_format": "hh-sol-cache-2",
|
|
3
3
|
"files": {
|
|
4
4
|
"/home/runner/work/hardhat/hardhat/coverage/contracts/test/fixtures/coverage/Foo.sol": {
|
|
5
|
-
"lastModificationDate":
|
|
5
|
+
"lastModificationDate": 1772921909571,
|
|
6
6
|
"contentHash": "3867fe733d707529b35534b0f07ffb91",
|
|
7
7
|
"sourceName": "coverage/contracts/test/fixtures/coverage/Foo.sol",
|
|
8
8
|
"solcConfig": {
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
</div><!-- /wrapper -->
|
|
110
110
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
111
111
|
Code coverage
|
|
112
|
-
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Mar 07 2026
|
|
112
|
+
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Mar 07 2026 22:18:31 GMT+0000 (Coordinated Universal Time)
|
|
113
113
|
</div>
|
|
114
114
|
</div>
|
|
115
115
|
<script src="../prettify.js"></script>
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
</div><!-- /wrapper -->
|
|
78
78
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
79
79
|
Code coverage
|
|
80
|
-
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Mar 07 2026
|
|
80
|
+
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Mar 07 2026 22:18:31 GMT+0000 (Coordinated Universal Time)
|
|
81
81
|
</div>
|
|
82
82
|
</div>
|
|
83
83
|
<script src="../prettify.js"></script>
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
</div><!-- /wrapper -->
|
|
78
78
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
79
79
|
Code coverage
|
|
80
|
-
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Mar 07 2026
|
|
80
|
+
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Mar 07 2026 22:18:31 GMT+0000 (Coordinated Universal Time)
|
|
81
81
|
</div>
|
|
82
82
|
</div>
|
|
83
83
|
<script src="prettify.js"></script>
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
</div><!-- /wrapper -->
|
|
110
110
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
111
111
|
Code coverage
|
|
112
|
-
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Mar 07 2026
|
|
112
|
+
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Mar 07 2026 22:18:31 GMT+0000 (Coordinated Universal Time)
|
|
113
113
|
</div>
|
|
114
114
|
</div>
|
|
115
115
|
<script src="../prettify.js"></script>
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
</div><!-- /wrapper -->
|
|
78
78
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
79
79
|
Code coverage
|
|
80
|
-
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Mar 07 2026
|
|
80
|
+
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Mar 07 2026 22:18:31 GMT+0000 (Coordinated Universal Time)
|
|
81
81
|
</div>
|
|
82
82
|
</div>
|
|
83
83
|
<script src="../prettify.js"></script>
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
</div><!-- /wrapper -->
|
|
78
78
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
79
79
|
Code coverage
|
|
80
|
-
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Mar 07 2026
|
|
80
|
+
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Mar 07 2026 22:18:31 GMT+0000 (Coordinated Universal Time)
|
|
81
81
|
</div>
|
|
82
82
|
</div>
|
|
83
83
|
<script src="prettify.js"></script>
|
package/lib/index.js
CHANGED
|
@@ -2034,7 +2034,7 @@ const taskArgsStore = { compileAll: false };
|
|
|
2034
2034
|
.addOptionalParam('package', 'Compile the contracts within a specific mono-repo package. Artifacts and 0xc classes will be placed in the package directory')
|
|
2035
2035
|
.addOptionalParam('tsgen', 'Skip the TypeScript class generation', true, config_1.types.boolean)
|
|
2036
2036
|
.addOptionalParam('install', 'CSV sol path to install, default installs all compiled contracts from sources')
|
|
2037
|
-
|
|
2037
|
+
//-.addOptionalParam('contractNameMatchMode', '"strict" - default: contractName === fileName | "anyInFile" all contracts in the file')
|
|
2038
2038
|
.addFlag('watch', 'Watch sources directory and reruns compilation task on changes')
|
|
2039
2039
|
.setAction(async (compilationArgs, { run, config, artifacts }, runSuper) => {
|
|
2040
2040
|
ConfigHelper.resetPaths(config.paths);
|
|
@@ -2044,6 +2044,9 @@ const taskArgsStore = { compileAll: false };
|
|
|
2044
2044
|
if (compilationArgs.install != null) {
|
|
2045
2045
|
config['0xweb'].install = compilationArgs.install;
|
|
2046
2046
|
}
|
|
2047
|
+
//- if (compilationArgs.contractNameMatchMode != null) {
|
|
2048
|
+
//- config['0xweb'].contractNameMatchMode = compilationArgs.contractNameMatchMode;
|
|
2049
|
+
//- }
|
|
2047
2050
|
if (compilationArgs.package != null) {
|
|
2048
2051
|
config['0xweb'].package = compilationArgs.package;
|
|
2049
2052
|
if (compilationArgs.artifacts == null) {
|
|
@@ -2181,10 +2184,10 @@ const taskArgsStore = { compileAll: false };
|
|
|
2181
2184
|
await runSuper();
|
|
2182
2185
|
});
|
|
2183
2186
|
async function getCompiledAbis(config, compileSolOutput) {
|
|
2184
|
-
var _a, _b, _c
|
|
2187
|
+
var _a, _b, _c;
|
|
2185
2188
|
const sources = config.paths.sources;
|
|
2186
2189
|
const installs = (_c = (_b = (_a = config['0xweb']) === null || _a === void 0 ? void 0 : _a.install) === null || _b === void 0 ? void 0 : _b.split(',').map(x => x.trim())) !== null && _c !== void 0 ? _c : null;
|
|
2187
|
-
const anyContractInFile =
|
|
2190
|
+
//-const anyContractInFile = config['0xweb']?.contractNameMatchMode === 'anyInFile';
|
|
2188
2191
|
const emittedArtifacts = (0, alot_1.default)(compileSolOutput.artifactsEmittedPerJob).mapMany((a) => {
|
|
2189
2192
|
return (0, alot_1.default)(a.artifactsEmittedPerFile).mapMany((artifactPerFile) => {
|
|
2190
2193
|
return (0, alot_1.default)(artifactPerFile.artifactsEmitted).map((artifactName) => {
|
|
@@ -2222,33 +2225,29 @@ async function getCompiledAbis(config, compileSolOutput) {
|
|
|
2222
2225
|
let arr = files
|
|
2223
2226
|
.map(file => {
|
|
2224
2227
|
let path = file.uri.toString();
|
|
2225
|
-
let
|
|
2226
|
-
|
|
2227
|
-
if (sourceFileNameMatch == null) {
|
|
2228
|
+
let match = /(?<fileName>[^\\\/]+)\.sol[\\\/](?<contractName>[^\.]+)\.json$/.exec(path);
|
|
2229
|
+
if (match == null) {
|
|
2228
2230
|
return null;
|
|
2229
2231
|
}
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
}
|
|
2235
|
-
name = contractNameMatch.groups.name;
|
|
2236
|
-
}
|
|
2237
|
-
else {
|
|
2238
|
-
// assume artifactName === sourceFileName
|
|
2239
|
-
name = sourceFileNameMatch.groups.name;
|
|
2240
|
-
if (compileAll !== true && name in namesHash === false) {
|
|
2241
|
-
return null;
|
|
2242
|
-
}
|
|
2243
|
-
if (new RegExp(`[\\\/]${name}\\.json$`).test(path) === false) {
|
|
2244
|
-
return null;
|
|
2245
|
-
}
|
|
2246
|
-
}
|
|
2247
|
-
if (name == null) {
|
|
2248
|
-
throw new Error(`Unable to determine contract name for file ${path}`);
|
|
2232
|
+
let { fileName, contractName } = match.groups;
|
|
2233
|
+
if (compileAll !== true && contractName in namesHash === false) {
|
|
2234
|
+
// Not all and no new hardhat compilation
|
|
2235
|
+
return null;
|
|
2249
2236
|
}
|
|
2237
|
+
// if (anyContractInFile === true) {
|
|
2238
|
+
// let contractNameMatch = /[\/\\](?<name>[^\.]+)\.json$/.exec(path);
|
|
2239
|
+
// if (contractNameMatch == null) {
|
|
2240
|
+
// return null;
|
|
2241
|
+
// }
|
|
2242
|
+
// name = contractNameMatch.groups.name;
|
|
2243
|
+
// } else {
|
|
2244
|
+
// // assume artifactName === sourceFileName
|
|
2245
|
+
// if (new RegExp(`[\\\/]${name}\\.json$`).test(path) === false) {
|
|
2246
|
+
// return null;
|
|
2247
|
+
// }
|
|
2248
|
+
// }
|
|
2250
2249
|
return {
|
|
2251
|
-
name:
|
|
2250
|
+
name: contractName,
|
|
2252
2251
|
path: path
|
|
2253
2252
|
};
|
|
2254
2253
|
})
|