@0xweb/hardhat 0.1.9 → 0.1.11
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 +27 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -143,8 +143,30 @@ const taskArgsStore = { compileAll: false };
|
|
|
143
143
|
.addOptionalParam('sources', 'Override the sources directory')
|
|
144
144
|
.addOptionalParam('artifacts', 'Override the artifacts output directory')
|
|
145
145
|
.addOptionalParam('root', 'Overrides root directory. If sources is also overriden must be the sub-folder of the sources dir')
|
|
146
|
-
.addOptionalParam('watch', 'Re-runs compilation task on changes'
|
|
146
|
+
.addOptionalParam('watch', 'Re-runs compilation task on changes', true, {
|
|
147
|
+
name: 'boolean',
|
|
148
|
+
validate(argName, argumentValue) { },
|
|
149
|
+
parse(val) {
|
|
150
|
+
if (val === '' || val === '1' || val === true || val === 'true') {
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
.addOptionalParam('tsgen', 'Skip the TypeScript class generation', true, {
|
|
157
|
+
name: 'boolean',
|
|
158
|
+
validate(argName, argumentValue) { },
|
|
159
|
+
parse(val) {
|
|
160
|
+
if (val === '0' || val === 0 || val === false || val === 'false') {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
})
|
|
147
166
|
.setAction(async (compilationArgs, { run, config, artifacts }, runSuper) => {
|
|
167
|
+
if (compilationArgs.tsgen === false) {
|
|
168
|
+
config['0xweb'].tsgen = false;
|
|
169
|
+
}
|
|
148
170
|
let { sources: sourcesDir, artifacts: artifactsDir, root: rootDir } = compilationArgs;
|
|
149
171
|
if (rootDir != null) {
|
|
150
172
|
rootDir = _path_1.$path.resolve(rootDir);
|
|
@@ -172,7 +194,7 @@ const taskArgsStore = { compileAll: false };
|
|
|
172
194
|
}
|
|
173
195
|
artifactsInstance._artifactsPath = artifactsDir;
|
|
174
196
|
}
|
|
175
|
-
if (compilationArgs.watch
|
|
197
|
+
if (compilationArgs.watch) {
|
|
176
198
|
const directory = `file://${config.paths.sources}/`;
|
|
177
199
|
atma_io_1.Directory.watch(directory, async (...args) => {
|
|
178
200
|
await runSuper();
|
|
@@ -194,6 +216,9 @@ const taskArgsStore = { compileAll: false };
|
|
|
194
216
|
.setAction(async (a, b) => {
|
|
195
217
|
let { compileSolOutput } = a;
|
|
196
218
|
let { config, artifacts } = b;
|
|
219
|
+
if (config['0xweb'].tsgen === false) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
197
222
|
const contracts = await getCompiledAbis(config, compileSolOutput);
|
|
198
223
|
const app = new _0xweb_1.App();
|
|
199
224
|
await (0, alot_1.default)(contracts)
|