@0xweb/hardhat 0.1.8 → 0.1.10

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 +13 -4
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -144,15 +144,22 @@ const taskArgsStore = { compileAll: false };
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
146
  .addOptionalParam('watch', 'Re-runs compilation task on changes')
147
+ .addOptionalParam('tsgen', 'Skip the TypeScript class generation', true, {
148
+ name: 'boolean',
149
+ validate(argName, argumentValue) { }
150
+ })
147
151
  .setAction(async (compilationArgs, { run, config, artifacts }, runSuper) => {
152
+ if (compilationArgs.tsgen === false) {
153
+ config['0xweb'].tsgen = false;
154
+ }
148
155
  let { sources: sourcesDir, artifacts: artifactsDir, root: rootDir } = compilationArgs;
149
156
  if (rootDir != null) {
150
157
  rootDir = _path_1.$path.resolve(rootDir);
151
158
  if (sourcesDir == null) {
152
- sourcesDir = _path_1.$path.join(rootDir, 'contracts');
159
+ sourcesDir = `file://${_path_1.$path.join(rootDir, 'contracts')}`;
153
160
  }
154
161
  if (artifactsDir == null) {
155
- artifactsDir = _path_1.$path.join(rootDir, 'artifacts');
162
+ artifactsDir = `file://${_path_1.$path.join(rootDir, 'artifacts')}`;
156
163
  }
157
164
  config.paths.root = rootDir;
158
165
  config.paths.cache = _path_1.$path.join(rootDir, 'cache');
@@ -163,8 +170,7 @@ const taskArgsStore = { compileAll: false };
163
170
  }
164
171
  if (artifactsDir) {
165
172
  artifactsDir = _path_1.$path.resolve(artifactsDir);
166
- config.paths.artifacts = _path_1.$path.join(artifactsDir, './artifacts/');
167
- config.paths.cache = _path_1.$path.join(artifactsDir, './cache/');
173
+ config.paths.artifacts = artifactsDir;
168
174
  // Re-set Artifacts Path manually, as Hardhat initializes the Artifacts Instance before this task runs.
169
175
  // Other paths (sources, cache) will be resolved later by hardhat from config
170
176
  const artifactsInstance = artifacts;
@@ -195,6 +201,9 @@ const taskArgsStore = { compileAll: false };
195
201
  .setAction(async (a, b) => {
196
202
  let { compileSolOutput } = a;
197
203
  let { config, artifacts } = b;
204
+ if (config['0xweb'].tsgen === false) {
205
+ return;
206
+ }
198
207
  const contracts = await getCompiledAbis(config, compileSolOutput);
199
208
  const app = new _0xweb_1.App();
200
209
  await (0, alot_1.default)(contracts)
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.8",
4
+ "version": "0.1.10",
5
5
  "main": "./lib/index.js",
6
6
  "author": {
7
7
  "name": "Alex Kit",