@graphprotocol/graph-cli 0.52.1-alpha-20230719162130-b3c9686 → 0.52.1-alpha-20230719201219-dde01c9

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,6 +1,6 @@
1
1
  # @graphprotocol/graph-cli
2
2
 
3
- ## 0.52.1-alpha-20230719162130-b3c9686
3
+ ## 0.52.1-alpha-20230719201219-dde01c9
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -9,10 +9,10 @@
9
9
  Thanks [@saihaj](https://github.com/saihaj)! - only update `network.json` file during `graph add`
10
10
  if it exists
11
11
 
12
- - [#1402](https://github.com/graphprotocol/graph-tooling/pull/1402)
13
- [`b3c9686`](https://github.com/graphprotocol/graph-tooling/commit/b3c96864a2566d45e75bcd858c1cae2df12b0275)
14
- Thanks [@saihaj](https://github.com/saihaj)! - show a descriptive error message and do not hang if
15
- there is a deploy key issue
12
+ - [#1403](https://github.com/graphprotocol/graph-tooling/pull/1403)
13
+ [`dde01c9`](https://github.com/graphprotocol/graph-tooling/commit/dde01c95527b6473e0eda6a533aa524d83f41e7c)
14
+ Thanks [@saihaj](https://github.com/saihaj)! - do not ask for local path when trying to add more
15
+ contracts during init
16
16
 
17
17
  - [#1400](https://github.com/graphprotocol/graph-tooling/pull/1400)
18
18
  [`e7423aa`](https://github.com/graphprotocol/graph-tooling/commit/e7423aa5a73a5b8a7919f92c558c49fe61be9c23)
@@ -107,6 +107,8 @@ class DeployCommand extends core_1.Command {
107
107
  required: true,
108
108
  });
109
109
  }
110
+ // eslint-disable-next-line @typescript-eslint/no-this-alias -- request needs it
111
+ const self = this;
110
112
  const deploySubgraph = async (ipfsHash) => {
111
113
  const spinner = gluegun_1.print.spin(`Deploying to Graph node ${requestUrl}`);
112
114
  client.request('subgraph_deploy', {
@@ -135,11 +137,7 @@ class DeployCommand extends core_1.Command {
135
137
  $ graph create --node ${node} ${subgraphName}`;
136
138
  }
137
139
  }
138
- if (jsonRpcError.message.match(/auth failure/)) {
139
- errorMessage += '\nYou may need to authenticate first.';
140
- }
141
- spinner.fail(errorMessage);
142
- this.exit(1);
140
+ self.error(errorMessage, { exit: 1 });
143
141
  }
144
142
  else if (requestError) {
145
143
  spinner.fail(`HTTP error deploying the subgraph ${requestError.code}`);
@@ -173,10 +171,7 @@ class DeployCommand extends core_1.Command {
173
171
  // we are provided the IPFS hash, so we deploy directly
174
172
  if (ipfsHash) {
175
173
  // Connect to the IPFS node (if a node address was provided)
176
- const ipfsClient = (0, ipfs_http_client_1.create)({
177
- url: (0, compiler_1.appendApiVersionForGraph)(ipfs.toString()),
178
- headers,
179
- });
174
+ const ipfsClient = (0, ipfs_http_client_1.create)({ url: (0, compiler_1.appendApiVersionForGraph)(ipfs.toString()), headers });
180
175
  // Fetch the manifest from IPFS
181
176
  const manifestBuffer = ipfsClient.cat(ipfsHash);
182
177
  let manifestFile = '';
@@ -277,7 +277,9 @@ async function processFromExampleInitForm({ directory: initDirectory, subgraphNa
277
277
  initial: initSubgraphName,
278
278
  validate: name => {
279
279
  try {
280
- (0, subgraph_1.validateSubgraphName)(name, { allowSimpleName: initAllowSimpleName });
280
+ (0, subgraph_1.validateSubgraphName)(name, {
281
+ allowSimpleName: initAllowSimpleName,
282
+ });
281
283
  return true;
282
284
  }
283
285
  catch (e) {
@@ -360,7 +362,9 @@ async function processInitForm({ protocol: initProtocol, product: initProduct, s
360
362
  initial: initSubgraphName,
361
363
  validate: name => {
362
364
  try {
363
- (0, subgraph_1.validateSubgraphName)(name, { allowSimpleName: initAllowSimpleName });
365
+ (0, subgraph_1.validateSubgraphName)(name, {
366
+ allowSimpleName: initAllowSimpleName,
367
+ });
364
368
  return true;
365
369
  }
366
370
  catch (e) {
@@ -819,7 +823,10 @@ async function initSubgraphFromContract({ protocolInstance, allowSimpleName, sub
819
823
  return;
820
824
  }
821
825
  while (addContract) {
822
- addContract = await addAnotherContract.bind(this)({ protocolInstance, directory });
826
+ addContract = await addAnotherContract.bind(this)({
827
+ protocolInstance,
828
+ directory,
829
+ });
823
830
  }
824
831
  }
825
832
  printNextSteps.bind(this)({ subgraphName, directory }, { commands });
@@ -831,7 +838,6 @@ async function addAnotherContract({ protocolInstance, directory, }) {
831
838
  });
832
839
  const addContractConfirmation = addContractAnswer.toLowerCase() === 'y';
833
840
  if (addContractConfirmation) {
834
- let abiFromFile = false;
835
841
  const ProtocolContract = protocolInstance.getContract();
836
842
  let contract = '';
837
843
  for (;;) {
@@ -844,15 +850,6 @@ async function addAnotherContract({ protocolInstance, directory, }) {
844
850
  }
845
851
  this.log(`✖ ${error}`);
846
852
  }
847
- const localAbi = await core_1.ux.prompt('\nProvide local ABI path? (y/n)', {
848
- required: true,
849
- type: 'single',
850
- });
851
- abiFromFile = localAbi.toLowerCase() === 'y';
852
- let abiPath = '';
853
- if (abiFromFile) {
854
- abiPath = await core_1.ux.prompt('\nABI file (path)', { required: true });
855
- }
856
853
  const contractName = await core_1.ux.prompt('\nContract Name', {
857
854
  required: true,
858
855
  default: 'Contract',
@@ -864,14 +861,6 @@ async function addAnotherContract({ protocolInstance, directory, }) {
864
861
  process.chdir(directory);
865
862
  }
866
863
  const commandLine = [contract, '--contract-name', contractName];
867
- if (abiFromFile) {
868
- if (abiPath.includes(directory)) {
869
- commandLine.push('--abi', path_1.default.normalize(abiPath.replace(directory, '')));
870
- }
871
- else {
872
- commandLine.push('--abi', abiPath);
873
- }
874
- }
875
864
  await add_1.default.run(commandLine);
876
865
  }
877
866
  catch (e) {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.52.1-alpha-20230719162130-b3c9686",
2
+ "version": "0.52.1-alpha-20230719201219-dde01c9",
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.1-alpha-20230719162130-b3c9686",
3
+ "version": "0.52.1-alpha-20230719201219-dde01c9",
4
4
  "description": "CLI for building for and deploying to The Graph",
5
5
  "license": "(Apache-2.0 OR MIT)",
6
6
  "engines": {