@graphprotocol/graph-cli 0.77.0-alpha-20240625192017-c89b0eb → 0.77.0-alpha-20240625201931-ef02c42
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 +1 -1
- package/dist/commands/publish.d.ts +3 -1
- package/dist/commands/publish.js +22 -5
- package/oclif.manifest.json +17 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,7 @@ export default class PublishCommand extends Command {
|
|
|
7
7
|
static flags: {
|
|
8
8
|
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
9
9
|
'subgraph-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
'protocol-network': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
11
|
ipfs: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
12
|
'ipfs-hash': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
13
|
'webapp-url': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
@@ -14,10 +15,11 @@ export default class PublishCommand extends Command {
|
|
|
14
15
|
/**
|
|
15
16
|
* Prompt the user to open up the browser to continue publishing the subgraph
|
|
16
17
|
*/
|
|
17
|
-
publishWithBrowser({ ipfsHash, webapp, subgraphId, }: {
|
|
18
|
+
publishWithBrowser({ ipfsHash, webapp, subgraphId, protocolNetwork, }: {
|
|
18
19
|
ipfsHash: string;
|
|
19
20
|
webapp: string;
|
|
20
21
|
subgraphId: string | undefined;
|
|
22
|
+
protocolNetwork: string | undefined;
|
|
21
23
|
}): Promise<void>;
|
|
22
24
|
run(): Promise<void>;
|
|
23
25
|
}
|
package/dist/commands/publish.js
CHANGED
|
@@ -40,7 +40,7 @@ class PublishCommand extends core_1.Command {
|
|
|
40
40
|
/**
|
|
41
41
|
* Prompt the user to open up the browser to continue publishing the subgraph
|
|
42
42
|
*/
|
|
43
|
-
async publishWithBrowser({ ipfsHash, webapp, subgraphId, }) {
|
|
43
|
+
async publishWithBrowser({ ipfsHash, webapp, subgraphId, protocolNetwork, }) {
|
|
44
44
|
const answer = await core_1.ux.prompt(`Press ${chalk_1.default.green('y')} (or any key) to open up the browser to continue publishing or ${chalk_1.default.yellow('q')} to exit`);
|
|
45
45
|
if (answer.toLowerCase() === 'q') {
|
|
46
46
|
this.exit(0);
|
|
@@ -51,15 +51,19 @@ class PublishCommand extends core_1.Command {
|
|
|
51
51
|
if (subgraphId) {
|
|
52
52
|
searchParams.set('subgraphId', subgraphId);
|
|
53
53
|
}
|
|
54
|
+
if (protocolNetwork) {
|
|
55
|
+
searchParams.set('network', protocolNetwork);
|
|
56
|
+
}
|
|
57
|
+
url.search = searchParams.toString();
|
|
54
58
|
const openUrl = url.toString();
|
|
55
|
-
gluegun_1.print.success(`Finalize the publish of the subgraph from the Graph CLI publish page. Opening up the browser to continue publishing at ${
|
|
59
|
+
gluegun_1.print.success(`Finalize the publish of the subgraph from the Graph CLI publish page. Opening up the browser to continue publishing at ${openUrl}`);
|
|
56
60
|
await (0, open_1.default)(openUrl);
|
|
57
61
|
return;
|
|
58
62
|
}
|
|
59
63
|
async run() {
|
|
60
|
-
const { args: { 'subgraph-manifest': manifest }, flags: { 'ipfs-hash': ipfsHash, 'webapp-url': webUiUrl, ipfs, 'subgraph-id': subgraphId }, } = await this.parse(PublishCommand);
|
|
64
|
+
const { args: { 'subgraph-manifest': manifest }, flags: { 'ipfs-hash': ipfsHash, 'webapp-url': webUiUrl, ipfs, 'subgraph-id': subgraphId, 'protocol-network': protocolNetwork, }, } = await this.parse(PublishCommand);
|
|
61
65
|
if (ipfsHash) {
|
|
62
|
-
await this.publishWithBrowser({ ipfsHash, webapp: webUiUrl, subgraphId });
|
|
66
|
+
await this.publishWithBrowser({ ipfsHash, webapp: webUiUrl, subgraphId, protocolNetwork });
|
|
63
67
|
return;
|
|
64
68
|
}
|
|
65
69
|
let protocol;
|
|
@@ -88,7 +92,12 @@ class PublishCommand extends core_1.Command {
|
|
|
88
92
|
process.exitCode = 1;
|
|
89
93
|
return;
|
|
90
94
|
}
|
|
91
|
-
await this.publishWithBrowser({
|
|
95
|
+
await this.publishWithBrowser({
|
|
96
|
+
ipfsHash: result,
|
|
97
|
+
webapp: webUiUrl,
|
|
98
|
+
subgraphId,
|
|
99
|
+
protocolNetwork,
|
|
100
|
+
});
|
|
92
101
|
return;
|
|
93
102
|
}
|
|
94
103
|
}
|
|
@@ -104,6 +113,14 @@ PublishCommand.flags = {
|
|
|
104
113
|
}),
|
|
105
114
|
'subgraph-id': core_1.Flags.string({
|
|
106
115
|
summary: 'Subgraph ID to publish to.',
|
|
116
|
+
required: false,
|
|
117
|
+
}),
|
|
118
|
+
'protocol-network': core_1.Flags.string({
|
|
119
|
+
summary: 'The network to use for the subgraph deployment.',
|
|
120
|
+
options: ['arbitrum-one', 'arbitrum-sepolia'],
|
|
121
|
+
default: 'arbitrum-one',
|
|
122
|
+
required: false,
|
|
123
|
+
dependsOn: ['subgraph-id'],
|
|
107
124
|
}),
|
|
108
125
|
ipfs: core_1.Flags.string({
|
|
109
126
|
summary: 'Upload build results to an IPFS node.',
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.77.0-alpha-
|
|
2
|
+
"version": "0.77.0-alpha-20240625201931-ef02c42",
|
|
3
3
|
"commands": {
|
|
4
4
|
"add": {
|
|
5
5
|
"id": "add",
|
|
@@ -766,8 +766,24 @@
|
|
|
766
766
|
"name": "subgraph-id",
|
|
767
767
|
"type": "option",
|
|
768
768
|
"summary": "Subgraph ID to publish to.",
|
|
769
|
+
"required": false,
|
|
769
770
|
"multiple": false
|
|
770
771
|
},
|
|
772
|
+
"protocol-network": {
|
|
773
|
+
"name": "protocol-network",
|
|
774
|
+
"type": "option",
|
|
775
|
+
"summary": "The network to use for the subgraph deployment.",
|
|
776
|
+
"required": false,
|
|
777
|
+
"multiple": false,
|
|
778
|
+
"options": [
|
|
779
|
+
"arbitrum-one",
|
|
780
|
+
"arbitrum-sepolia"
|
|
781
|
+
],
|
|
782
|
+
"dependsOn": [
|
|
783
|
+
"subgraph-id"
|
|
784
|
+
],
|
|
785
|
+
"default": "arbitrum-one"
|
|
786
|
+
},
|
|
771
787
|
"ipfs": {
|
|
772
788
|
"name": "ipfs",
|
|
773
789
|
"type": "option",
|
package/package.json
CHANGED