@0xweb/hardhat 0.1.13 → 0.1.15

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.
Files changed (2) hide show
  1. package/lib/index.js +22 -8
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -167,6 +167,16 @@ const taskArgsStore = { compileAll: false };
167
167
  if (compilationArgs.tsgen === false) {
168
168
  config['0xweb'].tsgen = false;
169
169
  }
170
+ ConfigHelper.resetPaths(config.paths);
171
+ // Re-set Artifacts Path manually, as Hardhat initializes the Artifacts Instance before this task runs.
172
+ // Other paths (sources, cache) will be resolved later by hardhat from config
173
+ const artifactsInstance = artifacts;
174
+ if (artifactsInstance._artifactsPath == null) {
175
+ console.error(`Articats Internal interface was changed. Trying to set private _artifactsPath, but it doesn't exist.`);
176
+ }
177
+ // Clean artifacts from previous compile
178
+ artifactsInstance._validArtifacts = [];
179
+ artifactsInstance._artifactsPath = config.paths.artifacts;
170
180
  let { sources: sourcesDir, artifacts: artifactsDir, root: rootDir } = compilationArgs;
171
181
  if (rootDir != null) {
172
182
  rootDir = _path_1.$path.resolve(rootDir);
@@ -186,15 +196,7 @@ const taskArgsStore = { compileAll: false };
186
196
  if (artifactsDir) {
187
197
  artifactsDir = _path_1.$path.resolve(artifactsDir);
188
198
  config.paths.artifacts = artifactsDir;
189
- // Re-set Artifacts Path manually, as Hardhat initializes the Artifacts Instance before this task runs.
190
- // Other paths (sources, cache) will be resolved later by hardhat from config
191
- const artifactsInstance = artifacts;
192
- if (artifactsInstance._artifactsPath == null) {
193
- console.error(`Articats Internal interface was changed. Trying to set private _artifactsPath, but it doesn't exist.`);
194
- }
195
199
  artifactsInstance._artifactsPath = artifactsDir;
196
- // Clean artifacts from previous compile
197
- artifactsInstance._validArtifacts = [];
198
200
  }
199
201
  if (compilationArgs.watch) {
200
202
  const directory = `file://${config.paths.sources}/`;
@@ -284,6 +286,18 @@ async function getCompiledAbis(config, compileSolOutput) {
284
286
  .filter(Boolean);
285
287
  return arr;
286
288
  }
289
+ var ConfigHelper;
290
+ (function (ConfigHelper) {
291
+ let $backup;
292
+ function resetPaths(paths) {
293
+ if ($backup == null) {
294
+ $backup = { ...paths };
295
+ return;
296
+ }
297
+ Object.assign(paths, $backup);
298
+ }
299
+ ConfigHelper.resetPaths = resetPaths;
300
+ })(ConfigHelper || (ConfigHelper = {}));
287
301
  //# sourceMappingURL=index.js.map
288
302
  //# sourceMappingURL=index.ts.map
289
303
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@0xweb/hardhat",
3
3
  "description": "Hardhat plugin for 0xweb",
4
- "version": "0.1.13",
4
+ "version": "0.1.15",
5
5
  "main": "./lib/index.js",
6
6
  "author": {
7
7
  "name": "Alex Kit",