@graphprotocol/graph-cli 0.41.0-alpha-20230220202444-8787a63 → 0.41.0-alpha-20230220204254-d199c93
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/commands/add.js +2 -2
- package/dist/commands/auth.js +1 -1
- package/dist/commands/build.js +1 -1
- package/dist/commands/create.js +1 -1
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/commands/local.js +1 -1
- package/dist/commands/remove.js +1 -1
- package/dist/commands/test.js +1 -1
- package/dist/compiler/index.js +28 -25
- package/dist/migrations/mapping_api_version_0_0_1.js +1 -1
- package/dist/migrations/mapping_api_version_0_0_2.js +1 -1
- package/dist/migrations/mapping_api_version_0_0_3.js +1 -1
- package/dist/migrations/mapping_api_version_0_0_4.js +1 -1
- package/dist/migrations/mapping_api_version_0_0_5.js +1 -1
- package/dist/migrations/spec_version_0_0_2.js +1 -1
- package/dist/migrations/spec_version_0_0_3.js +1 -1
- package/dist/protocols/ipfs/codegen/file_template.js +1 -0
- package/dist/type-generator.js +2 -2
- 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-alpha-
|
|
3
|
+
## 0.41.0-alpha-20230220204254-d199c93
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
+
- [#1076](https://github.com/graphprotocol/graph-tooling/pull/1076)
|
|
8
|
+
[`d199c93`](https://github.com/graphprotocol/graph-tooling/commit/d199c9332b169db95cbf36b1fc05517a4c98ec97)
|
|
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/commands/add.js
CHANGED
|
@@ -26,10 +26,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const gluegun_1 = require("gluegun");
|
|
30
|
-
const immutable_1 = __importDefault(require("immutable"));
|
|
31
29
|
const core_1 = require("@oclif/core");
|
|
32
30
|
const errors_1 = require("@oclif/core/lib/errors");
|
|
31
|
+
const gluegun_1 = require("gluegun");
|
|
32
|
+
const immutable_1 = __importDefault(require("immutable"));
|
|
33
33
|
const abi_1 = require("../command-helpers/abi");
|
|
34
34
|
const DataSourcesExtractor = __importStar(require("../command-helpers/data-sources"));
|
|
35
35
|
const network_1 = require("../command-helpers/network");
|
package/dist/commands/auth.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const gluegun_1 = require("gluegun");
|
|
4
3
|
const core_1 = require("@oclif/core");
|
|
4
|
+
const gluegun_1 = require("gluegun");
|
|
5
5
|
const auth_1 = require("../command-helpers/auth");
|
|
6
6
|
const node_1 = require("../command-helpers/node");
|
|
7
7
|
class AuthCommand extends core_1.Command {
|
package/dist/commands/build.js
CHANGED
|
@@ -26,8 +26,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const gluegun_1 = require("gluegun");
|
|
30
29
|
const core_1 = require("@oclif/core");
|
|
30
|
+
const gluegun_1 = require("gluegun");
|
|
31
31
|
const compiler_1 = require("../command-helpers/compiler");
|
|
32
32
|
const DataSourcesExtractor = __importStar(require("../command-helpers/data-sources"));
|
|
33
33
|
const network_1 = require("../command-helpers/network");
|
package/dist/commands/create.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const url_1 = require("url");
|
|
4
|
-
const gluegun_1 = require("gluegun");
|
|
5
4
|
const core_1 = require("@oclif/core");
|
|
5
|
+
const gluegun_1 = require("gluegun");
|
|
6
6
|
const auth_1 = require("../command-helpers/auth");
|
|
7
7
|
const jsonrpc_1 = require("../command-helpers/jsonrpc");
|
|
8
8
|
const node_1 = require("../command-helpers/node");
|
package/dist/commands/deploy.js
CHANGED
|
@@ -28,8 +28,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const path_1 = __importDefault(require("path"));
|
|
30
30
|
const url_1 = require("url");
|
|
31
|
-
const gluegun_1 = require("gluegun");
|
|
32
31
|
const core_1 = require("@oclif/core");
|
|
32
|
+
const gluegun_1 = require("gluegun");
|
|
33
33
|
const auth_1 = require("../command-helpers/auth");
|
|
34
34
|
const compiler_1 = require("../command-helpers/compiler");
|
|
35
35
|
const DataSourcesExtractor = __importStar(require("../command-helpers/data-sources"));
|
package/dist/commands/init.js
CHANGED
|
@@ -29,8 +29,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
const fs_1 = __importDefault(require("fs"));
|
|
30
30
|
const os_1 = __importDefault(require("os"));
|
|
31
31
|
const path_1 = __importDefault(require("path"));
|
|
32
|
-
const gluegun_1 = require("gluegun");
|
|
33
32
|
const core_1 = require("@oclif/core");
|
|
33
|
+
const gluegun_1 = require("gluegun");
|
|
34
34
|
const abi_1 = require("../command-helpers/abi");
|
|
35
35
|
const DataSourcesExtractor = __importStar(require("../command-helpers/data-sources"));
|
|
36
36
|
const network_1 = require("../command-helpers/network");
|
package/dist/commands/local.js
CHANGED
|
@@ -7,11 +7,11 @@ const child_process_1 = require("child_process");
|
|
|
7
7
|
const http_1 = __importDefault(require("http"));
|
|
8
8
|
const net_1 = __importDefault(require("net"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const core_1 = require("@oclif/core");
|
|
10
11
|
const docker_compose_1 = __importDefault(require("docker-compose"));
|
|
11
12
|
const gluegun_1 = require("gluegun");
|
|
12
13
|
const strip_ansi_1 = __importDefault(require("strip-ansi"));
|
|
13
14
|
const tmp_promise_1 = __importDefault(require("tmp-promise"));
|
|
14
|
-
const core_1 = require("@oclif/core");
|
|
15
15
|
const spinner_1 = require("../command-helpers/spinner");
|
|
16
16
|
// Clean up temporary files even when an uncaught exception occurs
|
|
17
17
|
tmp_promise_1.default.setGracefulCleanup();
|
package/dist/commands/remove.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const url_1 = require("url");
|
|
4
|
-
const gluegun_1 = require("gluegun");
|
|
5
4
|
const core_1 = require("@oclif/core");
|
|
5
|
+
const gluegun_1 = require("gluegun");
|
|
6
6
|
const auth_1 = require("../command-helpers/auth");
|
|
7
7
|
const jsonrpc_1 = require("../command-helpers/jsonrpc");
|
|
8
8
|
const node_1 = require("../command-helpers/node");
|
package/dist/commands/test.js
CHANGED
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const child_process_1 = require("child_process");
|
|
7
7
|
const os_1 = __importDefault(require("os"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const core_1 = require("@oclif/core");
|
|
9
10
|
const binary_install_raw_1 = require("binary-install-raw");
|
|
10
11
|
const gluegun_1 = require("gluegun");
|
|
11
12
|
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
12
13
|
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
13
14
|
const semver_1 = __importDefault(require("semver"));
|
|
14
|
-
const core_1 = require("@oclif/core");
|
|
15
15
|
class TestCommand extends core_1.Command {
|
|
16
16
|
async run() {
|
|
17
17
|
const { args: { datasource }, flags: { coverage, docker, force, logs, recompile, version }, } = await this.parse(TestCommand);
|
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,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable */
|
|
2
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
4
|
if (k2 === undefined) k2 = k;
|
|
4
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -26,7 +27,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
28
|
};
|
|
28
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
/* eslint-disable */
|
|
30
30
|
const toolbox = __importStar(require("gluegun"));
|
|
31
31
|
const semver_1 = __importDefault(require("semver"));
|
|
32
32
|
const load_manifest_1 = require("./util/load-manifest");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable */
|
|
2
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
4
|
if (k2 === undefined) k2 = k;
|
|
4
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -26,7 +27,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
28
|
};
|
|
28
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
/* eslint-disable */
|
|
30
30
|
const toolbox = __importStar(require("gluegun"));
|
|
31
31
|
const semver_1 = __importDefault(require("semver"));
|
|
32
32
|
const load_manifest_1 = require("./util/load-manifest");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable */
|
|
2
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
4
|
if (k2 === undefined) k2 = k;
|
|
4
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -26,7 +27,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
28
|
};
|
|
28
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
/* eslint-disable */
|
|
30
30
|
const toolbox = __importStar(require("gluegun"));
|
|
31
31
|
const semver_1 = __importDefault(require("semver"));
|
|
32
32
|
const load_manifest_1 = require("./util/load-manifest");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable */
|
|
2
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
4
|
if (k2 === undefined) k2 = k;
|
|
4
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -26,7 +27,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
28
|
};
|
|
28
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
/* eslint-disable */
|
|
30
30
|
const toolbox = __importStar(require("gluegun"));
|
|
31
31
|
const semver_1 = __importDefault(require("semver"));
|
|
32
32
|
const load_manifest_1 = require("./util/load-manifest");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable */
|
|
2
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
4
|
if (k2 === undefined) k2 = k;
|
|
4
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -26,7 +27,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
28
|
};
|
|
28
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
/* eslint-disable */
|
|
30
30
|
const toolbox = __importStar(require("gluegun"));
|
|
31
31
|
const semver_1 = __importDefault(require("semver"));
|
|
32
32
|
const load_manifest_1 = require("./util/load-manifest");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable */
|
|
2
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
4
|
if (k2 === undefined) k2 = k;
|
|
4
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -23,7 +24,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
24
|
return result;
|
|
24
25
|
};
|
|
25
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
/* eslint-disable */
|
|
27
27
|
const toolbox = __importStar(require("gluegun"));
|
|
28
28
|
const load_manifest_1 = require("./util/load-manifest");
|
|
29
29
|
// Spec version to 0.0.2 uses top level templates. graph-cli no longer supports
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable */
|
|
2
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
4
|
if (k2 === undefined) k2 = k;
|
|
4
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -23,7 +24,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
24
|
return result;
|
|
24
25
|
};
|
|
25
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
/* eslint-disable */
|
|
27
27
|
const toolbox = __importStar(require("gluegun"));
|
|
28
28
|
const load_manifest_1 = require("./util/load-manifest");
|
|
29
29
|
// Spec version 0.0.4 uses feature management, but features are
|
package/dist/type-generator.js
CHANGED
|
@@ -27,13 +27,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const path_1 = __importDefault(require("path"));
|
|
30
|
+
// @ts-expect-error TODO: type out if necessary
|
|
31
|
+
const Index_bs_js_1 = __importDefault(require("@float-capital/float-subgraph-uncrashable/src/Index.bs.js"));
|
|
30
32
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
31
33
|
const toolbox = __importStar(require("gluegun"));
|
|
32
34
|
const graphql = __importStar(require("graphql/language"));
|
|
33
35
|
const immutable_1 = __importDefault(require("immutable"));
|
|
34
36
|
const prettier_1 = __importDefault(require("prettier"));
|
|
35
|
-
// @ts-expect-error TODO: type out if necessary
|
|
36
|
-
const Index_bs_js_1 = __importDefault(require("@float-capital/float-subgraph-uncrashable/src/Index.bs.js"));
|
|
37
37
|
const template_1 = __importDefault(require("./codegen/template"));
|
|
38
38
|
const typescript_1 = require("./codegen/typescript");
|
|
39
39
|
const fs_1 = require("./command-helpers/fs");
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED