@graphprotocol/graph-cli 0.52.0 → 0.52.1-alpha-20230718210510-d7a5634

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,5 +1,19 @@
1
1
  # @graphprotocol/graph-cli
2
2
 
3
+ ## 0.52.1-alpha-20230718210510-d7a5634
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1400](https://github.com/graphprotocol/graph-tooling/pull/1400)
8
+ [`d7a5634`](https://github.com/graphprotocol/graph-tooling/commit/d7a5634e5ba40873e62ff580db51b83f995e9e83)
9
+ Thanks [@saihaj](https://github.com/saihaj)! - only update `network.json` file during `graph add`
10
+ if it exists
11
+
12
+ - [#1400](https://github.com/graphprotocol/graph-tooling/pull/1400)
13
+ [`d7a5634`](https://github.com/graphprotocol/graph-tooling/commit/d7a5634e5ba40873e62ff580db51b83f995e9e83)
14
+ Thanks [@saihaj](https://github.com/saihaj)! - ask for start block in `graph add` if we cannot
15
+ fetch the start block from etherscan
16
+
3
17
  ## 0.52.0
4
18
 
5
19
  ### Minor Changes
@@ -67,7 +67,19 @@ class AddCommand extends core_1.Command {
67
67
  }
68
68
  catch (error) {
69
69
  // If we can't get the start block, we'll just leave it out of the manifest
70
- // TODO: Ask the user for the start block
70
+ const { startBlock: userInputStartBlock } = await gluegun_1.prompt.ask([
71
+ {
72
+ type: 'input',
73
+ name: 'startBlock',
74
+ message: 'Start Block',
75
+ initial: '0',
76
+ validate: value => parseInt(value) >= 0,
77
+ result(value) {
78
+ return value;
79
+ },
80
+ },
81
+ ]);
82
+ startBlock = userInputStartBlock;
71
83
  }
72
84
  await (0, scaffold_1.writeABI)(ethabi, contractName);
73
85
  const { collisionEntities, onlyCollisions, abiData } = updateEventNamesOnCollision(ethabi, entities, contractName, mergeEntities);
@@ -90,7 +102,9 @@ class AddCommand extends core_1.Command {
90
102
  result.set('dataSources', dataSources.push(dataSource));
91
103
  await subgraph_1.default.write(result, manifestPath);
92
104
  // Update networks.json
93
- await (0, network_1.updateNetworksFile)(network, contractName, address, networksFile);
105
+ if (gluegun_1.filesystem.exists(networksFile)) {
106
+ await (0, network_1.updateNetworksFile)(network, contractName, address, networksFile);
107
+ }
94
108
  // Detect Yarn and/or NPM
95
109
  const yarn = gluegun_1.system.which('yarn');
96
110
  const npm = gluegun_1.system.which('npm');
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.52.0",
2
+ "version": "0.52.1-alpha-20230718210510-d7a5634",
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.52.0",
3
+ "version": "0.52.1-alpha-20230718210510-d7a5634",
4
4
  "description": "CLI for building for and deploying to The Graph",
5
5
  "license": "(Apache-2.0 OR MIT)",
6
6
  "engines": {