@graphprotocol/graph-cli 0.43.0 → 0.43.1-alpha-20230320211532-95edea6

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,18 @@
1
1
  # @graphprotocol/graph-cli
2
2
 
3
+ ## 0.43.1-alpha-20230320211532-95edea6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1201](https://github.com/graphprotocol/graph-tooling/pull/1201)
8
+ [`95edea6`](https://github.com/graphprotocol/graph-tooling/commit/95edea632dee687d18bcffa19d4108fe5da99a94)
9
+ Thanks [@saihaj](https://github.com/saihaj)! - make datasource and version optional args for test
10
+ command
11
+
12
+ - [`876bc52`](https://github.com/graphprotocol/graph-tooling/commit/876bc523e5a53db162d9b5aa79e9de76a9e92ccf)
13
+ Thanks [@saihaj](https://github.com/saihaj)! - Allow file data sources (with no network) to deploy
14
+ to the studio. File data sources don't have a network specified.
15
+
3
16
  ## 0.43.0
4
17
 
5
18
  ### Minor Changes
@@ -26,9 +26,10 @@ exports.allowedStudioNetworks = [
26
26
  ];
27
27
  const validateStudioNetwork = ({ studio, product, network, }) => {
28
28
  const isStudio = studio || product === 'subgraph-studio';
29
- const isAllowedNetwork = exports.allowedStudioNetworks.includes(
30
- // @ts-expect-error we're checking if the network is allowed
31
- network);
29
+ const isAllowedNetwork = !network ||
30
+ exports.allowedStudioNetworks.includes(
31
+ // @ts-expect-error we're checking if the network is allowed
32
+ network);
32
33
  if (isStudio && !isAllowedNetwork) {
33
34
  throw new Error(`The Subgraph Studio only allows subgraphs for these networks: ${exports.allowedStudioNetworks.join(', ')}`);
34
35
  }
@@ -16,6 +16,12 @@ describe('Version Command Helpers', () => {
16
16
  network: 'gnosis',
17
17
  })).not.toThrow(new Error(`The Subgraph Studio only allows subgraphs for these networks: ${studio_1.allowedStudioNetworks.join(', ')}`));
18
18
  });
19
+ test('And no network is passed', () => {
20
+ expect(() => (0, studio_1.validateStudioNetwork)({
21
+ studio: true,
22
+ network: undefined,
23
+ })).not.toThrow(new Error(`The Subgraph Studio only allows subgraphs for these networks: ${studio_1.allowedStudioNetworks.join(', ')}`));
24
+ });
19
25
  test("And it's NOT an allowed network", () => {
20
26
  expect(() => (0, studio_1.validateStudioNetwork)({
21
27
  product: 'subgraph-studio',
@@ -69,9 +69,7 @@ class TestCommand extends core_1.Command {
69
69
  exports.default = TestCommand;
70
70
  TestCommand.description = 'Runs rust binary for subgraph testing.';
71
71
  TestCommand.args = {
72
- datasource: core_1.Args.string({
73
- required: true,
74
- }),
72
+ datasource: core_1.Args.string(),
75
73
  };
76
74
  TestCommand.flags = {
77
75
  help: core_1.Flags.help({
@@ -100,7 +98,6 @@ TestCommand.flags = {
100
98
  version: core_1.Flags.string({
101
99
  summary: 'Choose the version of the rust binary that you want to be downloaded/used.',
102
100
  char: 'v',
103
- required: true,
104
101
  }),
105
102
  };
106
103
  function getLatestVersionFromCache(cachePath) {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.43.0",
2
+ "version": "0.43.1-alpha-20230320211532-95edea6",
3
3
  "commands": {
4
4
  "add": {
5
5
  "id": "add",
@@ -782,14 +782,12 @@
782
782
  "type": "option",
783
783
  "char": "v",
784
784
  "summary": "Choose the version of the rust binary that you want to be downloaded/used.",
785
- "required": true,
786
785
  "multiple": false
787
786
  }
788
787
  },
789
788
  "args": {
790
789
  "datasource": {
791
- "name": "datasource",
792
- "required": true
790
+ "name": "datasource"
793
791
  }
794
792
  }
795
793
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphprotocol/graph-cli",
3
- "version": "0.43.0",
3
+ "version": "0.43.1-alpha-20230320211532-95edea6",
4
4
  "description": "CLI for building for and deploying to The Graph",
5
5
  "license": "(Apache-2.0 OR MIT)",
6
6
  "engines": {