@graphprotocol/graph-cli 0.48.0-alpha-20230425170121-df2293c → 0.48.0

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,13 +1,20 @@
1
1
  # @graphprotocol/graph-cli
2
2
 
3
- ## 0.48.0-alpha-20230425170121-df2293c
3
+ ## 0.48.0
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - [#1306](https://github.com/graphprotocol/graph-tooling/pull/1306)
8
- [`f106dbf`](https://github.com/graphprotocol/graph-tooling/commit/f106dbf7e39d9c430c255f3eaafb591080c69e86)
9
- Thanks [@saihaj](https://github.com/saihaj)! - Add loadInBlock function for entities as part of
10
- codegen
7
+ - [#1257](https://github.com/graphprotocol/graph-tooling/pull/1257)
8
+ [`17b90d7`](https://github.com/graphprotocol/graph-tooling/commit/17b90d7e2d4abdd850755adc4630975fd2b957e7)
9
+ Thanks [@enisdenjo](https://github.com/enisdenjo)! - Bundle CLI as binary
10
+
11
+ ## 0.47.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [#1308](https://github.com/graphprotocol/graph-tooling/pull/1308)
16
+ [`dd765f4`](https://github.com/graphprotocol/graph-tooling/commit/dd765f4beb9e4964718b03428b39541bc48e6025)
17
+ Thanks [@saihaj](https://github.com/saihaj)! - allow `fantom` and `matic`
11
18
 
12
19
  ## 0.47.1
13
20
 
package/bin/run ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+
3
+ require('@oclif/core')
4
+ .run()
5
+ .then(require('@oclif/core/flush'))
6
+ .catch(require('@oclif/core/handle'));
package/bin/run.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node "%~dp0\run" %*
@@ -138,9 +138,6 @@ class SchemaCodeGenerator {
138
138
  \`Entities of type ${entityName} must have an ID of type ${idField.gqlTypeName()} but the id '\${id.displayData()}' is of type \${id.displayKind()}\`)
139
139
  store.set('${entityName}', ${idField.tsValueToString()}, this)
140
140
  }`),
141
- tsCodegen.staticMethod('loadInBlock', [tsCodegen.param('id', tsCodegen.namedType(idField.typeName()))], tsCodegen.nullableType(tsCodegen.namedType(entityName)), `
142
- return changetype<${entityName} | null>(store.get_in_block('${entityName}', ${idField.tsToString()}))
143
- `),
144
141
  tsCodegen.staticMethod('load', [tsCodegen.param('id', tsCodegen.namedType(idField.typeName()))], tsCodegen.nullableType(tsCodegen.namedType(entityName)), `
145
142
  return changetype<${entityName} | null>(store.get('${entityName}', ${idField.tsToString()}))
146
143
  `),
@@ -128,15 +128,6 @@ describe('Schema code generator', () => {
128
128
  \`Entities of type Account must have an ID of type String but the id '\${id.displayData()}' is of type \${id.displayKind()}\`)
129
129
  store.set('Account', id.toString(), this)
130
130
  }
131
- `,
132
- },
133
- {
134
- name: 'loadInBlock',
135
- static: true,
136
- params: [new typescript_1.Param('id', new typescript_1.NamedType('string'))],
137
- returnType: new typescript_1.NullableType(new typescript_1.NamedType('Account')),
138
- body: `
139
- return changetype<Account | null>(store.get_in_block('Account', id))
140
131
  `,
141
132
  },
142
133
  {
@@ -316,15 +307,6 @@ describe('Schema code generator', () => {
316
307
  \`Entities of type Wallet must have an ID of type String but the id '\${id.displayData()}' is of type \${id.displayKind()}\`)
317
308
  store.set('Wallet', id.toString(), this)
318
309
  }
319
- `,
320
- },
321
- {
322
- name: 'loadInBlock',
323
- static: true,
324
- params: [new typescript_1.Param('id', new typescript_1.NamedType('string'))],
325
- returnType: new typescript_1.NullableType(new typescript_1.NamedType('Wallet')),
326
- body: `
327
- return changetype<Wallet | null>(store.get_in_block('Wallet', id))
328
310
  `,
329
311
  },
330
312
  {
@@ -443,15 +425,6 @@ describe('Schema code generator', () => {
443
425
  " store.set('Task', id.toBytes().toHexString(), this)\n" +
444
426
  ' }',
445
427
  },
446
- {
447
- name: 'loadInBlock',
448
- static: true,
449
- params: [new typescript_1.Param('id', new typescript_1.NamedType('Bytes'))],
450
- returnType: new typescript_1.NullableType(new typescript_1.NamedType('Task')),
451
- body: '\n' +
452
- " return changetype<Task | null>(store.get_in_block('Task', id.toHexString()))\n" +
453
- ' ',
454
- },
455
428
  {
456
429
  name: 'load',
457
430
  static: true,
@@ -1,4 +1,4 @@
1
- export declare const allowedStudioNetworks: readonly ["mainnet", "rinkeby", "goerli", "gnosis", "chapel", "optimism-goerli", "clover", "fantom-testnet", "arbitrum-goerli", "fuji", "celo-alfajores", "mumbai", "aurora-testnet", "near-testnet", "theta-testnet-001", "osmo-test-4", "base-testnet", "celo", "arbitrum-one", "avalanche", "zksync-era", "sepolia", "polygon-zkevm-testnet", "polygon-zkevm"];
1
+ export declare const allowedStudioNetworks: readonly ["mainnet", "rinkeby", "goerli", "gnosis", "chapel", "optimism-goerli", "clover", "fantom", "matic", "fantom-testnet", "arbitrum-goerli", "fuji", "celo-alfajores", "mumbai", "aurora-testnet", "near-testnet", "theta-testnet-001", "osmo-test-4", "base-testnet", "celo", "arbitrum-one", "avalanche", "zksync-era", "sepolia", "polygon-zkevm-testnet", "polygon-zkevm"];
2
2
  export declare const validateStudioNetwork: ({ studio, product, network, }: {
3
3
  studio?: string | boolean | undefined;
4
4
  product?: string | undefined;
@@ -9,6 +9,8 @@ exports.allowedStudioNetworks = [
9
9
  'chapel',
10
10
  'optimism-goerli',
11
11
  'clover',
12
+ 'fantom',
13
+ 'matic',
12
14
  'fantom-testnet',
13
15
  'arbitrum-goerli',
14
16
  'fuji',
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.48.0-alpha-20230425170121-df2293c",
2
+ "version": "0.48.0",
3
3
  "commands": {
4
4
  "add": {
5
5
  "id": "add",
package/package.json CHANGED
@@ -1,20 +1,22 @@
1
1
  {
2
2
  "name": "@graphprotocol/graph-cli",
3
- "version": "0.48.0-alpha-20230425170121-df2293c",
3
+ "version": "0.48.0",
4
4
  "description": "CLI for building for and deploying to The Graph",
5
5
  "license": "(Apache-2.0 OR MIT)",
6
6
  "engines": {
7
7
  "node": ">=14"
8
8
  },
9
9
  "bin": {
10
- "graph": "dist/bin.js"
10
+ "graph": "bin/run"
11
11
  },
12
12
  "main": "dist/index.js",
13
13
  "files": [
14
14
  "CHANGELOG.md",
15
+ "bin",
15
16
  "dist",
16
17
  "oclif.manifest.json",
17
- "README.md"
18
+ "README.md",
19
+ "!dist/*.tar.gz"
18
20
  ],
19
21
  "dependencies": {
20
22
  "@float-capital/float-subgraph-uncrashable": "^0.0.0-alpha.4",
@@ -73,7 +75,8 @@
73
75
  ]
74
76
  },
75
77
  "scripts": {
76
- "build": "tsc -b tsconfig.build.json && oclif manifest && copyfiles -u 1 src/**/*.graphql dist/ && chmod +x ./dist/bin.js",
78
+ "build": "tsc -b tsconfig.build.json && oclif manifest && oclif readme && copyfiles -u 1 src/**/*.graphql dist/",
79
+ "oclif:pack": "npm pack && pnpm oclif pack tarballs --no-xz && node scripts/rename-tarballs.mjs",
77
80
  "test": "jest --verbose",
78
81
  "test:add": "jest tests/cli/add.test.ts --verbose",
79
82
  "test:init": "jest tests/cli/init.test.ts --verbose",
package/dist/bin.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
package/dist/bin.js DELETED
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || function (mod) {
20
- if (mod && mod.__esModule) return mod;
21
- var result = {};
22
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
- __setModuleDefault(result, mod);
24
- return result;
25
- };
26
- var __importDefault = (this && this.__importDefault) || function (mod) {
27
- return (mod && mod.__esModule) ? mod : { "default": mod };
28
- };
29
- Object.defineProperty(exports, "__esModule", { value: true });
30
- const oclif = __importStar(require("@oclif/core"));
31
- const flush_1 = __importDefault(require("@oclif/core/flush"));
32
- // @ts-expect-error Handle is a pure JS file
33
- const handle_1 = __importDefault(require("@oclif/core/handle"));
34
- oclif.run().then(flush_1.default).catch(handle_1.default);