@0xweb/hardhat 0.1.2 → 0.1.4
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 +7 -5
- package/package.json +1 -1
- package/readme.md +2 -1
package/lib/index.js
CHANGED
|
@@ -80,13 +80,13 @@ exports.TASK_0xWEB_GENERATE = '0xweb:generate';
|
|
|
80
80
|
"use strict";
|
|
81
81
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
82
82
|
const alot_1 = require("alot");
|
|
83
|
-
const path = require("path");
|
|
84
83
|
const task_names_1 = require("hardhat/builtin-tasks/task-names");
|
|
85
84
|
const config_1 = require("hardhat/config");
|
|
86
85
|
const config_2 = _src_config;
|
|
87
86
|
const constants_1 = _src_constants;
|
|
88
87
|
const atma_io_1 = require("atma-io");
|
|
89
88
|
const _0xweb_1 = require("0xweb");
|
|
89
|
+
const _path_1 = require("./utils/$path");
|
|
90
90
|
const taskArgsStore = { compileAll: false };
|
|
91
91
|
(0, config_1.extendConfig)((config) => {
|
|
92
92
|
config['0xweb'] = (0, config_2.resolveConfig)(config);
|
|
@@ -97,18 +97,18 @@ const taskArgsStore = { compileAll: false };
|
|
|
97
97
|
.addOptionalParam('watch', 'Re-runs compilation task on changes')
|
|
98
98
|
.setAction(async (compilationArgs, { run, config }, runSuper) => {
|
|
99
99
|
if (compilationArgs.sources) {
|
|
100
|
-
config.paths.sources = path.
|
|
100
|
+
config.paths.sources = _path_1.$path.resolve(compilationArgs.sources);
|
|
101
101
|
}
|
|
102
102
|
if (compilationArgs.artifacts) {
|
|
103
|
-
config.paths.artifacts = path.
|
|
103
|
+
config.paths.artifacts = _path_1.$path.resolve(compilationArgs.artifacts);
|
|
104
104
|
}
|
|
105
105
|
if (compilationArgs.watch != null) {
|
|
106
106
|
const directory = `file://${config.paths.sources}/`;
|
|
107
107
|
atma_io_1.Directory.watch(directory, async (...args) => {
|
|
108
|
-
console.log('XX', args);
|
|
109
108
|
await runSuper();
|
|
110
109
|
});
|
|
111
110
|
await runSuper();
|
|
111
|
+
// prevent from exit
|
|
112
112
|
await new Promise(resolve => { });
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
@@ -157,7 +157,9 @@ async function getCompiledAbis(config, compileSolOutput) {
|
|
|
157
157
|
name: artifactName,
|
|
158
158
|
sourceFile: 'file://' + artifactPerFile.file.absolutePath
|
|
159
159
|
};
|
|
160
|
-
})
|
|
160
|
+
})
|
|
161
|
+
.filter(x => x.sourceFile.includes('@openzeppelin') === false)
|
|
162
|
+
.toArray();
|
|
161
163
|
}).toArray();
|
|
162
164
|
}).toArray();
|
|
163
165
|
let namesHash = (0, alot_1.default)(emitedArtifacts).toDictionary(x => x.name);
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -59,7 +59,7 @@ import { HardhatProvider } from '@dequanto/hardhat/HardhatProvider'
|
|
|
59
59
|
|
|
60
60
|
// automatically deploys the contract to hardhat chain
|
|
61
61
|
const deployer = new HardhatProvider();
|
|
62
|
-
const foo = await deployer.
|
|
62
|
+
const foo = await deployer.deployClass<Foo>(Foo, { arguments: [ 'Hello' ] });
|
|
63
63
|
|
|
64
64
|
// write
|
|
65
65
|
const tx = await foo.setName('Hello world')
|
|
@@ -95,5 +95,6 @@ const text = await foo.name();
|
|
|
95
95
|
|
|
96
96
|
- `npx hardhat compile --source /foo/bar/qux` - compiles solidity files which are located outside the `/contracts` folder
|
|
97
97
|
- `npx hardhat compile --artifacts /dist` - set custom folder for artifacts (ABI JSONs and TS contracts)
|
|
98
|
+
- `npx hardhat compile --watch` - Compile the sources and waits to recompile on changes
|
|
98
99
|
|
|
99
100
|
----
|