@0xweb/hardhat 0.1.5 → 0.1.7

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 +59 -4
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  var _src_config = {};
6
6
  var _src_constants = {};
7
+ var _src_utils__path = {};
7
8
 
8
9
  // source ./ModuleSimplified.js
9
10
  var _src_config;
@@ -77,6 +78,53 @@ exports.TASK_0xWEB_GENERATE = '0xweb:generate';
77
78
 
78
79
  // end:source ./ModuleSimplified.js
79
80
 
81
+
82
+ // source ./ModuleSimplified.js
83
+ var _src_utils__path;
84
+ (function () {
85
+ // ensure AMD is not active for the model, so that any UMD exports as commonjs
86
+ var define = null;
87
+ var exports = _src_utils__path != null ? _src_utils__path : {};
88
+ var module = { exports: exports };
89
+
90
+ "use strict";
91
+ Object.defineProperty(exports, "__esModule", { value: true });
92
+ exports.$path = void 0;
93
+ const pathUtil = require("path");
94
+ var $path;
95
+ (function ($path) {
96
+ function resolve(path) {
97
+ if (path.startsWith('file:')) {
98
+ path = path.replace(/^file:\/\//g, '');
99
+ return path;
100
+ }
101
+ return pathUtil.join(process.cwd(), path);
102
+ }
103
+ $path.resolve = resolve;
104
+ function combine(...paths) {
105
+ return pathUtil.join(...paths);
106
+ }
107
+ $path.combine = combine;
108
+ })($path = exports.$path || (exports.$path = {}));
109
+ //# sourceMappingURL=$path.js.map
110
+ //# sourceMappingURL=$path.ts.map;
111
+
112
+ function __isObj(x) {
113
+ return x != null && typeof x === 'object' && x.constructor === Object;
114
+ }
115
+ if (_src_utils__path === module.exports) {
116
+ // do nothing if
117
+ } else if (__isObj(_src_utils__path) && __isObj(module.exports)) {
118
+ Object.assign(_src_utils__path, module.exports);
119
+ } else {
120
+ _src_utils__path = module.exports;
121
+ }
122
+
123
+ ;
124
+ }());
125
+
126
+ // end:source ./ModuleSimplified.js
127
+
80
128
  "use strict";
81
129
  Object.defineProperty(exports, "__esModule", { value: true });
82
130
  const alot_1 = require("alot");
@@ -86,7 +134,7 @@ const config_2 = _src_config;
86
134
  const constants_1 = _src_constants;
87
135
  const atma_io_1 = require("atma-io");
88
136
  const _0xweb_1 = require("0xweb");
89
- const _path_1 = require("./utils/$path");
137
+ const _path_1 = _src_utils__path;
90
138
  const taskArgsStore = { compileAll: false };
91
139
  (0, config_1.extendConfig)((config) => {
92
140
  config['0xweb'] = (0, config_2.resolveConfig)(config);
@@ -95,12 +143,19 @@ const taskArgsStore = { compileAll: false };
95
143
  .addOptionalParam('sources', 'Override the sources directory')
96
144
  .addOptionalParam('artifacts', 'Override the artifacts output directory')
97
145
  .addOptionalParam('watch', 'Re-runs compilation task on changes')
98
- .setAction(async (compilationArgs, { run, config }, runSuper) => {
146
+ .setAction(async (compilationArgs, { run, config, artifacts }, runSuper) => {
99
147
  if (compilationArgs.sources) {
100
148
  config.paths.sources = _path_1.$path.resolve(compilationArgs.sources);
101
149
  }
102
150
  if (compilationArgs.artifacts) {
103
- config.paths.artifacts = _path_1.$path.resolve(compilationArgs.artifacts);
151
+ const artifactsDir = _path_1.$path.resolve(compilationArgs.artifacts);
152
+ const artifactsInstance = artifacts;
153
+ config.paths.artifacts = artifactsDir;
154
+ if (artifactsInstance._artifactsPath == null) {
155
+ console.error(`Articats Internal interface was changed. Trying to set private _artifactsPath, but it doesn't exist.`);
156
+ }
157
+ artifactsInstance._artifactsPath = artifactsDir;
158
+ config.paths.cache = _path_1.$path.combine(artifactsDir, '../cache/');
104
159
  }
105
160
  if (compilationArgs.watch != null) {
106
161
  const directory = `file://${config.paths.sources}/`;
@@ -114,7 +169,7 @@ const taskArgsStore = { compileAll: false };
114
169
  }
115
170
  await runSuper();
116
171
  });
117
- (0, config_1.subtask)(task_names_1.TASK_COMPILE_SOLIDITY_COMPILE_JOBS, 'Compiles the entire project, building all artifacts')
172
+ (0, config_1.subtask)(task_names_1.TASK_COMPILE_SOLIDITY_COMPILE_JOBS, 'Compiles the entire project, building all artifacts and generating 0xweb TS classes')
118
173
  .setAction(async (taskArgs, { run }, runSuper) => {
119
174
  const compileSolOutput = await runSuper(taskArgs);
120
175
  await run(constants_1.TASK_0xWEB_GENERATE, { compileSolOutput });
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.5",
4
+ "version": "0.1.7",
5
5
  "main": "./lib/index.js",
6
6
  "author": {
7
7
  "name": "Alex Kit",
@@ -62,7 +62,7 @@
62
62
  "atma-io",
63
63
  "0xweb",
64
64
  "^hardhat",
65
- "path"
65
+ "^path$"
66
66
  ],
67
67
  "middlewares": {
68
68
  "ts": [