@graphprotocol/graph-cli 0.49.0-alpha-20230503003405-bb6ab90 → 0.49.0-alpha-20230503021722-4d9a2fc

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.49.0-alpha-20230503003405-bb6ab90
3
+ ## 0.49.0-alpha-20230503021722-4d9a2fc
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -11,9 +11,10 @@
11
11
 
12
12
  ### Patch Changes
13
13
 
14
- - [#1329](https://github.com/graphprotocol/graph-tooling/pull/1329)
15
- [`7309799`](https://github.com/graphprotocol/graph-tooling/commit/73097990312d41c290edafc375610d6497c39710)
16
- Thanks [@saihaj](https://github.com/saihaj)! - Point to new examples repo instead of old
14
+ - [#1331](https://github.com/graphprotocol/graph-tooling/pull/1331)
15
+ [`4d9a2fc`](https://github.com/graphprotocol/graph-tooling/commit/4d9a2fc333c9541350ca87029e4dc31635ca8a25)
16
+ Thanks [@saihaj](https://github.com/saihaj)! - only allow mainnet for substreams in network
17
+ selection for init
17
18
 
18
19
  ## 0.48.0
19
20
 
@@ -47,7 +47,7 @@ const add_1 = __importDefault(require("./add"));
47
47
  const initDebug = (0, debug_1.default)('graph-cli:init');
48
48
  const protocolChoices = Array.from(protocols_1.default.availableProtocols().keys());
49
49
  const availableNetworks = protocols_1.default.availableNetworks();
50
- const DEFAULT_EXAMPLE_SUBGRAPH = 'ethereum-gravatar';
50
+ const DEFAULT_EXAMPLE_SUBGRAPH = 'ethereum/gravatar';
51
51
  class InitCommand extends core_1.Command {
52
52
  async run() {
53
53
  const { args: { subgraphName, directory }, flags: { protocol, product, studio, node: nodeFlag, 'allow-simple-name': allowSimpleNameFlag, 'from-contract': fromContract, 'contract-name': contractName, 'from-example': fromExample, 'index-events': indexEvents, network, abi: abiPath, 'start-block': startBlock, }, } = await this.parse(InitCommand);
@@ -579,17 +579,12 @@ async function initSubgraphFromExample({ fromExample, allowSimpleName, subgraphN
579
579
  const prefix = path_1.default.join(os_1.default.tmpdir(), 'example-subgraph-');
580
580
  const tmpDir = fs_1.default.mkdtempSync(prefix);
581
581
  try {
582
- await gluegun_1.system.run(`git clone https://github.com/graphprotocol/graph-tooling ${tmpDir}`);
582
+ await gluegun_1.system.run(`git clone http://github.com/graphprotocol/example-subgraphs ${tmpDir}`);
583
583
  // If an example is not specified, use the default one
584
584
  if (fromExample === undefined || fromExample === true) {
585
585
  fromExample = DEFAULT_EXAMPLE_SUBGRAPH;
586
586
  }
587
- // Legacy purposes when everything existed in examples repo
588
- if (fromExample === 'ethereum/gravatar') {
589
- fromExample = DEFAULT_EXAMPLE_SUBGRAPH;
590
- }
591
- const exampleSubgraphPath = path_1.default.join(tmpDir, 'examples', String(fromExample));
592
- console.log('exampleSubgraphPath', exampleSubgraphPath);
587
+ const exampleSubgraphPath = path_1.default.join(tmpDir, String(fromExample));
593
588
  if (!gluegun_1.filesystem.exists(exampleSubgraphPath)) {
594
589
  return { result: false, error: `Example not found: ${fromExample}` };
595
590
  }
@@ -88,7 +88,7 @@ class Protocol {
88
88
  });
89
89
  }
90
90
  static availableNetworks() {
91
- let networks = immutable_1.default.fromJS({
91
+ return immutable_1.default.fromJS({
92
92
  arweave: ['arweave-mainnet'],
93
93
  ethereum: [
94
94
  'mainnet',
@@ -135,13 +135,6 @@ class Protocol {
135
135
  ],
136
136
  substreams: ['mainnet'],
137
137
  });
138
- const allNetworks = [];
139
- // eslint-disable-next-line unicorn/no-array-for-each
140
- networks.forEach(value => {
141
- allNetworks.push(...value);
142
- });
143
- networks = networks.set('substreams', immutable_1.default.List(allNetworks));
144
- return networks;
145
138
  }
146
139
  static normalizeName(name) {
147
140
  return Protocol.availableProtocols().findKey(possibleNames => {
package/dist/subgraph.js CHANGED
@@ -95,9 +95,7 @@ class Subgraph {
95
95
  }
96
96
  static validateRepository(manifest) {
97
97
  const repository = manifest.get('repository');
98
- return /^https:\/\/github\.com\/graphprotocol\/graph-tooling?$/.test(repository) ||
99
- // For legacy reasons, we should error on example subgraphs
100
- /^https:\/\/github\.com\/graphprotocol\/example-subgraphs?$/.test(repository)
98
+ return /^https:\/\/github\.com\/graphprotocol\/example-subgraphs?$/.test(repository)
101
99
  ? immutable_1.default.List().push(immutable_1.default.fromJS({
102
100
  path: ['repository'],
103
101
  message: `\
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.49.0-alpha-20230503003405-bb6ab90",
2
+ "version": "0.49.0-alpha-20230503021722-4d9a2fc",
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.49.0-alpha-20230503003405-bb6ab90",
3
+ "version": "0.49.0-alpha-20230503021722-4d9a2fc",
4
4
  "description": "CLI for building for and deploying to The Graph",
5
5
  "license": "(Apache-2.0 OR MIT)",
6
6
  "engines": {