@graphprotocol/graph-cli 0.41.0-alpha-20230220202916-954959f → 0.41.0
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 +9 -1
- package/dist/compiler/index.js +28 -25
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
# @graphprotocol/graph-cli
|
|
2
2
|
|
|
3
|
-
## 0.41.0
|
|
3
|
+
## 0.41.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
+
- [#1076](https://github.com/graphprotocol/graph-tooling/pull/1076)
|
|
8
|
+
[`c18a663`](https://github.com/graphprotocol/graph-tooling/commit/c18a66349e18c21636d83a19388df1580848aa64)
|
|
9
|
+
Thanks [@saihaj](https://github.com/saihaj)! - add `base-testnet` to studio
|
|
10
|
+
|
|
7
11
|
- [#1055](https://github.com/graphprotocol/graph-tooling/pull/1055)
|
|
8
12
|
[`044cd92`](https://github.com/graphprotocol/graph-tooling/commit/044cd92d0ceb9628c7f7fbe3627a09b867710247)
|
|
9
13
|
Thanks [@enisdenjo](https://github.com/enisdenjo)! - Migrate to Oclif
|
|
@@ -21,6 +25,10 @@
|
|
|
21
25
|
[`e84d1e8`](https://github.com/graphprotocol/graph-tooling/commit/e84d1e873d9b2a8967c5fe2a85fce48b2caeb75f)
|
|
22
26
|
Thanks [@saihaj](https://github.com/saihaj)! - update GH issues link for error message
|
|
23
27
|
|
|
28
|
+
- [#1071](https://github.com/graphprotocol/graph-tooling/pull/1071)
|
|
29
|
+
[`17d0888`](https://github.com/graphprotocol/graph-tooling/commit/17d08884fbc30a78089403e13139622b4145e9ff)
|
|
30
|
+
Thanks [@saihaj](https://github.com/saihaj)! - global files are not needed when using substreams
|
|
31
|
+
|
|
24
32
|
## 0.40.0
|
|
25
33
|
|
|
26
34
|
### Minor Changes
|
package/dist/compiler/index.js
CHANGED
|
@@ -48,34 +48,31 @@ 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
|
-
|
|
61
|
-
if (
|
|
62
|
-
|
|
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.');
|
|
51
|
+
this.protocol = this.options.protocol;
|
|
52
|
+
this.ABI = this.protocol.getABI();
|
|
53
|
+
if (options.protocol.name === 'substreams') {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
for (let dir = path_1.default.resolve(this.sourceDir);
|
|
57
|
+
// Terminate after the root dir or when we have found node_modules
|
|
58
|
+
dir !== undefined;
|
|
59
|
+
// Continue with the parent directory, terminate after the root dir
|
|
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'));
|
|
70
63
|
}
|
|
71
|
-
this.globalsFile = path_1.default.join(globalsLib, globalsFile);
|
|
72
64
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
throw new Error('Globals file is missing.');
|
|
65
|
+
if (this.libsDirs.length === 0) {
|
|
66
|
+
throw Error(`could not locate \`node_modules\` in parent directories of subgraph manifest`);
|
|
76
67
|
}
|
|
77
|
-
|
|
78
|
-
|
|
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.');
|
|
74
|
+
}
|
|
75
|
+
this.globalsFile = path_1.default.join(globalsLib, globalsFile);
|
|
79
76
|
process.on('uncaughtException', e => {
|
|
80
77
|
toolbox.print.error(`UNCAUGHT EXCEPTION: ${e}`);
|
|
81
78
|
});
|
|
@@ -233,6 +230,9 @@ class Compiler {
|
|
|
233
230
|
// Create output directory
|
|
234
231
|
fs_extra_1.default.mkdirsSync(path_1.default.dirname(outFile));
|
|
235
232
|
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,6 +271,9 @@ 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
|
+
}
|
|
274
277
|
const global = path_1.default.relative(baseDir, this.globalsFile);
|
|
275
278
|
asc.compile({
|
|
276
279
|
inputFile,
|
package/oclif.manifest.json
CHANGED