@graphprotocol/graph-cli 0.49.0 → 0.49.1-alpha-20230510041127-4083908

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,13 @@
1
1
  # @graphprotocol/graph-cli
2
2
 
3
+ ## 0.49.1-alpha-20230510041127-4083908
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1329](https://github.com/graphprotocol/graph-tooling/pull/1329)
8
+ [`7309799`](https://github.com/graphprotocol/graph-tooling/commit/73097990312d41c290edafc375610d6497c39710)
9
+ Thanks [@saihaj](https://github.com/saihaj)! - Point to new examples repo instead of old
10
+
3
11
  ## 0.49.0
4
12
 
5
13
  ### Minor Changes
@@ -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,12 +579,16 @@ 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 http://github.com/graphprotocol/example-subgraphs ${tmpDir}`);
582
+ await gluegun_1.system.run(`git clone https://github.com/graphprotocol/graph-tooling ${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
- const exampleSubgraphPath = path_1.default.join(tmpDir, String(fromExample));
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));
588
592
  if (!gluegun_1.filesystem.exists(exampleSubgraphPath)) {
589
593
  return { result: false, error: `Example not found: ${fromExample}` };
590
594
  }
package/dist/subgraph.js CHANGED
@@ -95,7 +95,9 @@ class Subgraph {
95
95
  }
96
96
  static validateRepository(manifest) {
97
97
  const repository = manifest.get('repository');
98
- return /^https:\/\/github\.com\/graphprotocol\/example-subgraphs?$/.test(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)
99
101
  ? immutable_1.default.List().push(immutable_1.default.fromJS({
100
102
  path: ['repository'],
101
103
  message: `\
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.49.0",
2
+ "version": "0.49.1-alpha-20230510041127-4083908",
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",
3
+ "version": "0.49.1-alpha-20230510041127-4083908",
4
4
  "description": "CLI for building for and deploying to The Graph",
5
5
  "license": "(Apache-2.0 OR MIT)",
6
6
  "engines": {