@graphprotocol/graph-cli 0.57.0-alpha-20230831103613-4c8bdf8 → 0.57.0-alpha-20230901180212-97b8d5c

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 CHANGED
@@ -1,13 +1,38 @@
1
1
  # @graphprotocol/graph-cli
2
2
 
3
- ## 0.57.0-alpha-20230831103613-4c8bdf8
3
+ ## 0.57.0-alpha-20230901180212-97b8d5c
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - [#1434](https://github.com/graphprotocol/graph-tooling/pull/1434)
8
- [`4c8bdf8`](https://github.com/graphprotocol/graph-tooling/commit/4c8bdf8acb655cd397f24f2e1639baf6cff4ac3e)
9
- Thanks [@incrypto32](https://github.com/incrypto32)! - Add data source context support in ethereum
10
- manifest
7
+ - [#1439](https://github.com/graphprotocol/graph-tooling/pull/1439)
8
+ [`d022733`](https://github.com/graphprotocol/graph-tooling/commit/d02273337efdcafb3276c8d998988b47352634fa)
9
+ Thanks [@saihaj](https://github.com/saihaj)! - Enable autocomplete for CLI commands. To configure
10
+ run
11
+ ```bash
12
+ graph autocomplete
13
+ ```
14
+ and follow the steps in the prompt.
15
+
16
+ ### Patch Changes
17
+
18
+ - [#1439](https://github.com/graphprotocol/graph-tooling/pull/1439)
19
+ [`4728d76`](https://github.com/graphprotocol/graph-tooling/commit/4728d766f94cf310e712ca336a908513cbb6cf94)
20
+ Thanks [@saihaj](https://github.com/saihaj)! - dependencies updates:
21
+
22
+ - Added dependency
23
+ [`@oclif/plugin-autocomplete@^2.3.6` ↗︎](https://www.npmjs.com/package/@oclif/plugin-autocomplete/v/2.3.6)
24
+ (to `dependencies`)
25
+
26
+ - [#1442](https://github.com/graphprotocol/graph-tooling/pull/1442)
27
+ [`ded8ea5`](https://github.com/graphprotocol/graph-tooling/commit/ded8ea541dae6e7c1f885b0b3bea9c0fbeaf4e47)
28
+ Thanks [@saihaj](https://github.com/saihaj)! - dependencies updates:
29
+
30
+ - Updated dependency [`prettier@1.19.1` ↗︎](https://www.npmjs.com/package/prettier/v/1.19.1)
31
+ (from `3.0.3`, in `dependencies`)
32
+
33
+ - [#1435](https://github.com/graphprotocol/graph-tooling/pull/1435)
34
+ [`f05b47c`](https://github.com/graphprotocol/graph-tooling/commit/f05b47cf64912d0c66255c9f0076f1696a708ff2)
35
+ Thanks [@saihaj](https://github.com/saihaj)! - update prettier
11
36
 
12
37
  ## 0.56.0
13
38
 
@@ -637,8 +662,8 @@
637
662
  [`044cd92`](https://github.com/graphprotocol/graph-tooling/commit/044cd92d0ceb9628c7f7fbe3627a09b867710247)
638
663
  Thanks [@enisdenjo](https://github.com/enisdenjo)! - dependencies updates:
639
664
 
640
- - Added dependency [`@oclif/core@2.0.7` ↗︎](https://www.npmjs.com/package/@oclif/core/v/2.0.7) (to
641
- `dependencies`)
665
+ - Added dependency [`@oclif/core@2.0.7` ↗︎](https://www.npmjs.com/package/@oclif/core/v/2.0.7)
666
+ (to `dependencies`)
642
667
 
643
668
  - [#1074](https://github.com/graphprotocol/graph-tooling/pull/1074)
644
669
  [`e84d1e8`](https://github.com/graphprotocol/graph-tooling/commit/e84d1e873d9b2a8967c5fe2a85fce48b2caeb75f)
@@ -734,8 +759,8 @@
734
759
  [`4c5e452`](https://github.com/graphprotocol/graph-cli/commit/4c5e452cbc2eceb75db29019fb3b4c769c9618f4)
735
760
  Thanks [@saihaj](https://github.com/saihaj)! - dependencies updates:
736
761
 
737
- - Updated dependency [`immutable@4.2.1` ↗︎](https://www.npmjs.com/package/immutable/v/4.2.1) (from
738
- `3.8.2`, in `dependencies`)
762
+ - Updated dependency [`immutable@4.2.1` ↗︎](https://www.npmjs.com/package/immutable/v/4.2.1)
763
+ (from `3.8.2`, in `dependencies`)
739
764
 
740
765
  - [`d42f199`](https://github.com/graphprotocol/graph-cli/commit/d42f199502df7bac79e8cafc667d5c712f5a3599)
741
766
  Thanks [@darienmh](https://github.com/darienmh)! - fix `chapel` network etherscan URL
@@ -1,6 +1,6 @@
1
+ import type { DefinitionNode, FieldDefinitionNode, InterfaceTypeDefinitionNode, NamedTypeNode, ObjectTypeDefinitionNode, TypeNode } from 'graphql/language';
1
2
  import Schema from '../schema';
2
3
  import * as tsCodegen from './typescript';
3
- import type { DefinitionNode, FieldDefinitionNode, InterfaceTypeDefinitionNode, NamedTypeNode, ObjectTypeDefinitionNode, TypeNode } from 'graphql/language';
4
4
  declare class IdField {
5
5
  static BYTES: symbol;
6
6
  static STRING: symbol;
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.loadAbiFromBlockScout = exports.getStartBlockForContract = exports.fetchTransactionByHashFromRPC = exports.fetchContractCreationHashWithRetry = exports.fetchDeployContractTransactionFromEtherscan = exports.loadStartBlockForContract = exports.loadAbiFromEtherscan = void 0;
7
- const fetch_1 = require("@whatwg-node/fetch");
8
7
  const immutable_1 = __importDefault(require("immutable"));
8
+ const fetch_1 = require("@whatwg-node/fetch");
9
9
  const spinner_1 = require("./spinner");
10
10
  const loadAbiFromEtherscan = async (ABICtor, network, address) => await (0, spinner_1.withSpinner)(`Fetching ABI from Etherscan`, `Failed to fetch ABI from Etherscan`, `Warnings while fetching ABI from Etherscan`, async () => {
11
11
  const scanApiUrl = getEtherscanLikeAPIUrl(network);
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.fromManifest = exports.fromManifestString = exports.fromFilePath = void 0;
7
- const js_yaml_1 = __importDefault(require("js-yaml"));
8
7
  const immutable_1 = __importDefault(require("immutable"));
8
+ const js_yaml_1 = __importDefault(require("js-yaml"));
9
9
  const load_manifest_1 = require("../migrations/util/load-manifest");
10
10
  // Loads manifest from file path and returns all:
11
11
  // - data sources
@@ -15,26 +15,26 @@ export declare const generateScaffold: ({ protocolInstance, abi, contract, netwo
15
15
  node?: string | undefined;
16
16
  spkgPath?: string | undefined;
17
17
  }, spinner: Spinner) => Promise<{
18
- 'subgraph.yaml': string;
19
- 'schema.graphql': string;
20
- 'package.json': string;
18
+ 'subgraph.yaml': Promise<string>;
19
+ 'schema.graphql': Promise<string>;
20
+ 'package.json': Promise<string>;
21
21
  'tsconfig.json'?: undefined;
22
22
  src?: undefined;
23
23
  abis?: undefined;
24
24
  tests?: undefined;
25
25
  } | {
26
- 'package.json': string;
27
- 'subgraph.yaml': string;
28
- 'schema.graphql': string;
29
- 'tsconfig.json': string;
26
+ 'package.json': Promise<string>;
27
+ 'subgraph.yaml': Promise<string>;
28
+ 'schema.graphql': Promise<string>;
29
+ 'tsconfig.json': Promise<string>;
30
30
  src: {
31
- [x: string]: string;
31
+ [x: string]: Promise<string>;
32
32
  } | undefined;
33
33
  abis: {
34
- [x: string]: string;
34
+ [x: string]: Promise<string>;
35
35
  } | undefined;
36
36
  tests: {
37
- [x: string]: string;
37
+ [x: string]: Promise<string>;
38
38
  } | undefined;
39
39
  }>;
40
40
  export declare const writeScaffold: (scaffold: any, directory: string, spinner: Spinner) => Promise<void>;
@@ -17,9 +17,13 @@ const tests_1 = require("../scaffold/tests");
17
17
  const spinner_1 = require("./spinner");
18
18
  const generateDataSource = async (protocol, contractName, network, contractAddress, abi, startBlock) => {
19
19
  const protocolManifest = protocol.getManifestScaffold();
20
- return immutable_1.Map.of('kind', protocol.name, 'name', contractName, 'network', network, 'source', yaml_1.default.parse(prettier_1.default.format(protocolManifest.source({ contract: contractAddress, contractName, startBlock }), {
20
+ return immutable_1.Map.of('kind', protocol.name, 'name', contractName, 'network', network, 'source', yaml_1.default.parse(await prettier_1.default.format(protocolManifest.source({
21
+ contract: contractAddress,
22
+ contractName,
23
+ startBlock,
24
+ }), {
21
25
  parser: 'yaml',
22
- })), 'mapping', yaml_1.default.parse(prettier_1.default.format(protocolManifest.mapping({ abi, contractName }), {
26
+ })), 'mapping', yaml_1.default.parse(await prettier_1.default.format(protocolManifest.mapping({ abi, contractName }), {
23
27
  parser: 'yaml',
24
28
  }))).asMutable();
25
29
  };
@@ -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 core_1 = require("@oclif/core");
30
- const errors_1 = require("@oclif/core/lib/errors");
31
29
  const gluegun_1 = require("gluegun");
32
30
  const immutable_1 = __importDefault(require("immutable"));
31
+ const core_1 = require("@oclif/core");
32
+ const errors_1 = require("@oclif/core/lib/errors");
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");
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
3
  const gluegun_1 = require("gluegun");
4
+ const core_1 = require("@oclif/core");
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 {
@@ -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 core_1 = require("@oclif/core");
30
29
  const gluegun_1 = require("gluegun");
30
+ const core_1 = require("@oclif/core");
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");
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
3
  const gluegun_1 = require("gluegun");
4
+ const core_1 = require("@oclif/core");
5
5
  class CleanCommand extends core_1.Command {
6
6
  async run() {
7
7
  const { flags: { 'codegen-dir': codegenDir, 'build-dir': buildDir }, } = await this.parse(CleanCommand);
@@ -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 core_1 = require("@oclif/core");
5
4
  const gluegun_1 = require("gluegun");
5
+ const core_1 = require("@oclif/core");
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");
@@ -28,8 +28,9 @@ 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 core_1 = require("@oclif/core");
32
31
  const gluegun_1 = require("gluegun");
32
+ const ipfs_http_client_1 = require("ipfs-http-client");
33
+ const core_1 = require("@oclif/core");
33
34
  const auth_1 = require("../command-helpers/auth");
34
35
  const compiler_1 = require("../command-helpers/compiler");
35
36
  const DataSourcesExtractor = __importStar(require("../command-helpers/data-sources"));
@@ -40,7 +41,6 @@ const node_1 = require("../command-helpers/node");
40
41
  const studio_1 = require("../command-helpers/studio");
41
42
  const version_1 = require("../command-helpers/version");
42
43
  const protocols_1 = __importDefault(require("../protocols"));
43
- const ipfs_http_client_1 = require("ipfs-http-client");
44
44
  const headersFlag = core_1.Flags.custom({
45
45
  summary: 'Add custom headers that will be used by the IPFS HTTP client.',
46
46
  aliases: ['hdr'],
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const fs_1 = __importDefault(require("fs"));
7
7
  const os_1 = __importDefault(require("os"));
8
8
  const path_1 = __importDefault(require("path"));
9
- const core_1 = require("@oclif/core");
10
9
  const gluegun_1 = require("gluegun");
10
+ const core_1 = require("@oclif/core");
11
11
  const abi_1 = require("../command-helpers/abi");
12
12
  const network_1 = require("../command-helpers/network");
13
13
  const node_1 = require("../command-helpers/node");
@@ -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");
11
10
  const docker_compose_1 = __importDefault(require("docker-compose"));
12
11
  const gluegun_1 = require("gluegun");
13
12
  const strip_ansi_1 = __importDefault(require("strip-ansi"));
14
13
  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();
@@ -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 core_1 = require("@oclif/core");
5
4
  const gluegun_1 = require("gluegun");
5
+ const core_1 = require("@oclif/core");
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");
@@ -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");
10
- const fetch_1 = require("@whatwg-node/fetch");
11
9
  const binary_install_raw_1 = require("binary-install-raw");
12
10
  const gluegun_1 = require("gluegun");
13
11
  const js_yaml_1 = __importDefault(require("js-yaml"));
14
12
  const semver_1 = __importDefault(require("semver"));
13
+ const core_1 = require("@oclif/core");
14
+ const fetch_1 = require("@whatwg-node/fetch");
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);
@@ -8,7 +8,6 @@ scalar String
8
8
  scalar File
9
9
  scalar BigInt
10
10
  scalar Boolean
11
- scalar JSON
12
11
 
13
12
  type SubgraphManifest {
14
13
  specVersion: String!
@@ -29,7 +28,6 @@ type DataSource {
29
28
  kind: String!
30
29
  name: String!
31
30
  network: String
32
- context: JSON
33
31
  source: ContractSource!
34
32
  mapping: ContractMapping!
35
33
  }
@@ -24,42 +24,42 @@ export default class Scaffold {
24
24
  startBlock?: string;
25
25
  spkgPath?: string;
26
26
  constructor(options: ScaffoldOptions);
27
- generatePackageJson(): string;
28
- generatePackageJsonForSubstreams(): string;
29
- generateManifest(): string;
30
- generateSchema(): string;
31
- generateTsConfig(): string;
27
+ generatePackageJson(): Promise<string>;
28
+ generatePackageJsonForSubstreams(): Promise<string>;
29
+ generateManifest(): Promise<string>;
30
+ generateSchema(): Promise<string>;
31
+ generateTsConfig(): Promise<string>;
32
32
  generateMappings(): {
33
- [x: string]: string;
33
+ [x: string]: Promise<string>;
34
34
  } | undefined;
35
- generateMapping(): string;
35
+ generateMapping(): Promise<string>;
36
36
  generateABIs(): {
37
- [x: string]: string;
37
+ [x: string]: Promise<string>;
38
38
  } | undefined;
39
39
  generateTests(): {
40
- [x: string]: string;
40
+ [x: string]: Promise<string>;
41
41
  } | undefined;
42
42
  generate(): {
43
- 'subgraph.yaml': string;
44
- 'schema.graphql': string;
45
- 'package.json': string;
43
+ 'subgraph.yaml': Promise<string>;
44
+ 'schema.graphql': Promise<string>;
45
+ 'package.json': Promise<string>;
46
46
  'tsconfig.json'?: undefined;
47
47
  src?: undefined;
48
48
  abis?: undefined;
49
49
  tests?: undefined;
50
50
  } | {
51
- 'package.json': string;
52
- 'subgraph.yaml': string;
53
- 'schema.graphql': string;
54
- 'tsconfig.json': string;
51
+ 'package.json': Promise<string>;
52
+ 'subgraph.yaml': Promise<string>;
53
+ 'schema.graphql': Promise<string>;
54
+ 'tsconfig.json': Promise<string>;
55
55
  src: {
56
- [x: string]: string;
56
+ [x: string]: Promise<string>;
57
57
  } | undefined;
58
58
  abis: {
59
- [x: string]: string;
59
+ [x: string]: Promise<string>;
60
60
  } | undefined;
61
61
  tests: {
62
- [x: string]: string;
62
+ [x: string]: Promise<string>;
63
63
  } | undefined;
64
64
  };
65
65
  }
@@ -1,3 +1,3 @@
1
1
  export declare const generateTestsFiles: (contract: any, events: any[], indexEvents?: boolean) => {
2
- [x: string]: string;
2
+ [x: string]: Promise<string>;
3
3
  };
package/dist/schema.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import SchemaCodeGenerator from './codegen/schema';
2
1
  import type { DocumentNode } from 'graphql/language';
2
+ import SchemaCodeGenerator from './codegen/schema';
3
3
  export default class Schema {
4
4
  filename: string;
5
5
  document: string;
@@ -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"));
32
30
  const fs_extra_1 = __importDefault(require("fs-extra"));
33
31
  const toolbox = __importStar(require("gluegun"));
34
32
  const graphql = __importStar(require("graphql/language"));
35
33
  const immutable_1 = __importDefault(require("immutable"));
36
34
  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");
@@ -154,20 +154,6 @@ const validators = immutable_1.default.fromJS({
154
154
  message: `Expected filename, found ${typeName(value)}:\n${value}`,
155
155
  },
156
156
  ]),
157
- JSON: (value, ctx) => {
158
- try {
159
- JSON.parse(JSON.stringify(value));
160
- return List();
161
- }
162
- catch (e) {
163
- return immutable_1.default.fromJS([
164
- {
165
- path: ctx.get('path'),
166
- message: `Invalid JSON value: ${e.message}`,
167
- },
168
- ]);
169
- }
170
- },
171
157
  Boolean: (value, ctx) => typeof value === 'boolean'
172
158
  ? List()
173
159
  : immutable_1.default.fromJS([
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.57.0-alpha-20230831103613-4c8bdf8",
2
+ "version": "0.57.0-alpha-20230901180212-97b8d5c",
3
3
  "commands": {
4
4
  "add": {
5
5
  "id": "add",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphprotocol/graph-cli",
3
- "version": "0.57.0-alpha-20230831103613-4c8bdf8",
3
+ "version": "0.57.0-alpha-20230901180212-97b8d5c",
4
4
  "description": "CLI for building for and deploying to The Graph",
5
5
  "license": "(Apache-2.0 OR MIT)",
6
6
  "engines": {
@@ -21,6 +21,7 @@
21
21
  "dependencies": {
22
22
  "@float-capital/float-subgraph-uncrashable": "^0.0.0-alpha.4",
23
23
  "@oclif/core": "2.8.6",
24
+ "@oclif/plugin-autocomplete": "^2.3.6",
24
25
  "@whatwg-node/fetch": "^0.8.4",
25
26
  "assemblyscript": "0.19.23",
26
27
  "binary-install-raw": "0.0.13",
@@ -72,6 +73,9 @@
72
73
  ],
73
74
  "additionalVersionFlags": [
74
75
  "-v"
76
+ ],
77
+ "plugins": [
78
+ "@oclif/plugin-autocomplete"
75
79
  ]
76
80
  },
77
81
  "scripts": {