@graphprotocol/graph-cli 0.41.0-alpha-20230217172405-3ebc28f → 0.41.0-alpha-20230220185627-41f7e04
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/CHANGELOG.md +4 -4
- package/dist/command-helpers/studio.js +1 -0
- package/dist/compiler/asc.js +1 -1
- package/dist/compiler/index.js +25 -28
- package/dist/protocols/index.js +1 -0
- package/oclif.manifest.json +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @graphprotocol/graph-cli
|
|
2
2
|
|
|
3
|
-
## 0.41.0-alpha-
|
|
3
|
+
## 0.41.0-alpha-20230220185627-41f7e04
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
- Added dependency [`@oclif/core@2.0.7` ↗︎](https://www.npmjs.com/package/@oclif/core/v/2.0.7) (to
|
|
18
18
|
`dependencies`)
|
|
19
19
|
|
|
20
|
-
- [#
|
|
21
|
-
[`
|
|
22
|
-
Thanks [@saihaj](https://github.com/saihaj)! -
|
|
20
|
+
- [#1074](https://github.com/graphprotocol/graph-tooling/pull/1074)
|
|
21
|
+
[`e84d1e8`](https://github.com/graphprotocol/graph-tooling/commit/e84d1e873d9b2a8967c5fe2a85fce48b2caeb75f)
|
|
22
|
+
Thanks [@saihaj](https://github.com/saihaj)! - update GH issues link for error message
|
|
23
23
|
|
|
24
24
|
## 0.40.0
|
|
25
25
|
|
package/dist/compiler/asc.js
CHANGED
|
@@ -30,7 +30,7 @@ const createExitHandler = (inputFile) => () => {
|
|
|
30
30
|
Suggestion: try to comment the whole file and uncomment it little by little while re-running the graph-cli until you isolate the line where the problem happens.
|
|
31
31
|
Also, please contact us so we can make the CLI better by handling errors like this. You can reach out in any of these links:
|
|
32
32
|
- Discord channel: https://discord.gg/eM8CA6WA9r
|
|
33
|
-
- Github issues: https://github.com/graphprotocol/graph-
|
|
33
|
+
- Github issues: https://github.com/graphprotocol/graph-tooling/issues/new/choose`);
|
|
34
34
|
};
|
|
35
35
|
const setupExitHandler = (exitHandler) => process.addListener('exit', exitHandler);
|
|
36
36
|
const removeExitHandler = (exitHandler) => process.removeListener('exit', exitHandler);
|
package/dist/compiler/index.js
CHANGED
|
@@ -48,31 +48,34 @@ class Compiler {
|
|
|
48
48
|
this.sourceDir = path_1.default.dirname(options.subgraphManifest);
|
|
49
49
|
this.blockIpfsMethods = options.blockIpfsMethods;
|
|
50
50
|
this.libsDirs = [];
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
dir = path_1.default.dirname(dir) === dir ? undefined : path_1.default.dirname(dir)) {
|
|
61
|
-
if (fs_extra_1.default.existsSync(path_1.default.join(dir, 'node_modules'))) {
|
|
62
|
-
this.libsDirs.push(path_1.default.join(dir, 'node_modules'));
|
|
51
|
+
if (options.protocol.name !== 'substreams') {
|
|
52
|
+
for (let dir = path_1.default.resolve(this.sourceDir);
|
|
53
|
+
// Terminate after the root dir or when we have found node_modules
|
|
54
|
+
dir !== undefined;
|
|
55
|
+
// Continue with the parent directory, terminate after the root dir
|
|
56
|
+
dir = path_1.default.dirname(dir) === dir ? undefined : path_1.default.dirname(dir)) {
|
|
57
|
+
if (fs_extra_1.default.existsSync(path_1.default.join(dir, 'node_modules'))) {
|
|
58
|
+
this.libsDirs.push(path_1.default.join(dir, 'node_modules'));
|
|
59
|
+
}
|
|
63
60
|
}
|
|
61
|
+
if (this.libsDirs.length === 0) {
|
|
62
|
+
throw Error(`could not locate \`node_modules\` in parent directories of subgraph manifest`);
|
|
63
|
+
}
|
|
64
|
+
const globalsFile = path_1.default.join('@graphprotocol', 'graph-ts', 'global', 'global.ts');
|
|
65
|
+
const globalsLib = this.libsDirs.find(item => {
|
|
66
|
+
return fs_extra_1.default.existsSync(path_1.default.join(item, globalsFile));
|
|
67
|
+
});
|
|
68
|
+
if (!globalsLib) {
|
|
69
|
+
throw Error('Could not locate `@graphprotocol/graph-ts` package in parent directories of subgraph manifest.');
|
|
70
|
+
}
|
|
71
|
+
this.globalsFile = path_1.default.join(globalsLib, globalsFile);
|
|
64
72
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const globalsFile = path_1.default.join('@graphprotocol', 'graph-ts', 'global', 'global.ts');
|
|
69
|
-
const globalsLib = this.libsDirs.find(item => {
|
|
70
|
-
return fs_extra_1.default.existsSync(path_1.default.join(item, globalsFile));
|
|
71
|
-
});
|
|
72
|
-
if (!globalsLib) {
|
|
73
|
-
throw Error('Could not locate `@graphprotocol/graph-ts` package in parent directories of subgraph manifest.');
|
|
73
|
+
// @ts-expect-error assigned or not, we dont care
|
|
74
|
+
if (!this.globalsFile) {
|
|
75
|
+
throw new Error('Globals file is missing.');
|
|
74
76
|
}
|
|
75
|
-
this.
|
|
77
|
+
this.protocol = this.options.protocol;
|
|
78
|
+
this.ABI = this.protocol.getABI();
|
|
76
79
|
process.on('uncaughtException', e => {
|
|
77
80
|
toolbox.print.error(`UNCAUGHT EXCEPTION: ${e}`);
|
|
78
81
|
});
|
|
@@ -230,9 +233,6 @@ class Compiler {
|
|
|
230
233
|
// Create output directory
|
|
231
234
|
fs_extra_1.default.mkdirsSync(path_1.default.dirname(outFile));
|
|
232
235
|
const libs = this.libsDirs.join(',');
|
|
233
|
-
if (!this.globalsFile) {
|
|
234
|
-
throw Error('Could not locate `@graphprotocol/graph-ts` package in parent directories of subgraph manifest.');
|
|
235
|
-
}
|
|
236
236
|
const global = path_1.default.relative(baseDir, this.globalsFile);
|
|
237
237
|
asc.compile({
|
|
238
238
|
inputFile,
|
|
@@ -271,9 +271,6 @@ class Compiler {
|
|
|
271
271
|
// Create output directory
|
|
272
272
|
fs_extra_1.default.mkdirsSync(path_1.default.dirname(outFile));
|
|
273
273
|
const libs = this.libsDirs.join(',');
|
|
274
|
-
if (!this.globalsFile) {
|
|
275
|
-
throw Error('Could not locate `@graphprotocol/graph-ts` package in parent directories of subgraph manifest.');
|
|
276
|
-
}
|
|
277
274
|
const global = path_1.default.relative(baseDir, this.globalsFile);
|
|
278
275
|
asc.compile({
|
|
279
276
|
inputFile,
|
package/dist/protocols/index.js
CHANGED
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.41.0-alpha-
|
|
2
|
+
"version": "0.41.0-alpha-20230220185627-41f7e04",
|
|
3
3
|
"commands": {
|
|
4
4
|
"add": {
|
|
5
5
|
"id": "add",
|
|
@@ -569,6 +569,7 @@
|
|
|
569
569
|
"optimism-kovan",
|
|
570
570
|
"aurora",
|
|
571
571
|
"aurora-testnet",
|
|
572
|
+
"base-testnet",
|
|
572
573
|
"near-mainnet",
|
|
573
574
|
"near-testnet",
|
|
574
575
|
"cosmoshub-4",
|
package/package.json
CHANGED