@graphprotocol/graph-cli 0.64.0-alpha-20231215205836-6d9a26b → 0.64.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,6 +1,6 @@
1
1
  # @graphprotocol/graph-cli
2
2
 
3
- ## 0.64.0-alpha-20231215205836-6d9a26b
3
+ ## 0.64.0
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -11,13 +11,6 @@
11
11
 
12
12
  ### Patch Changes
13
13
 
14
- - [#1536](https://github.com/graphprotocol/graph-tooling/pull/1536)
15
- [`3d4108e`](https://github.com/graphprotocol/graph-tooling/commit/3d4108e40a3f37f1468eaad01398112ffe441506)
16
- Thanks [@saihaj](https://github.com/saihaj)! - dependencies updates:
17
-
18
- - Updated dependency [`prettier@3.0.3` ↗︎](https://www.npmjs.com/package/prettier/v/3.0.3) (from
19
- `1.19.1`, in `dependencies`)
20
-
21
14
  - [#1545](https://github.com/graphprotocol/graph-tooling/pull/1545)
22
15
  [`1cfc8ce`](https://github.com/graphprotocol/graph-tooling/commit/1cfc8ce67388ebb9c6dcb1195119959ecd9be325)
23
16
  Thanks [@saihaj](https://github.com/saihaj)! - dependencies updates:
@@ -29,33 +29,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  const assert_1 = __importDefault(require("assert"));
30
30
  const graphql = __importStar(require("graphql/language"));
31
31
  const prettier_1 = __importDefault(require("prettier"));
32
- const vitest_1 = require("vitest");
33
32
  const schema_1 = __importDefault(require("../schema"));
34
33
  const schema_2 = __importDefault(require("./schema"));
35
34
  const typescript_1 = require("./typescript");
36
- const formatTS = async (code) => await prettier_1.default.format(code, { parser: 'typescript', semi: false });
35
+ const formatTS = (code) => prettier_1.default.format(code, { parser: 'typescript', semi: false });
37
36
  const createSchemaCodeGen = (schema) => new schema_2.default(new schema_1.default('', schema, graphql.parse(schema)));
38
- const testEntity = async (generatedTypes, expectedEntity) => {
37
+ const testEntity = (generatedTypes, expectedEntity) => {
39
38
  const entity = generatedTypes.find(type => type.name === expectedEntity.name);
40
- (0, vitest_1.expect)(entity instanceof typescript_1.Class).toBe(true);
41
- (0, vitest_1.expect)(entity.extends).toBe('Entity');
42
- (0, vitest_1.expect)(entity.export).toBe(true);
39
+ expect(entity instanceof typescript_1.Class).toBe(true);
40
+ expect(entity.extends).toBe('Entity');
41
+ expect(entity.export).toBe(true);
43
42
  const { members, methods } = entity;
44
- (0, vitest_1.expect)(members).toStrictEqual(expectedEntity.members);
43
+ expect(members).toStrictEqual(expectedEntity.members);
45
44
  for (const expectedMethod of expectedEntity.methods) {
46
45
  const method = methods.find((method) => method.name === expectedMethod.name);
47
46
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
48
47
  expectedMethod.static
49
- ? (0, vitest_1.expect)(method instanceof typescript_1.StaticMethod).toBe(true)
50
- : (0, vitest_1.expect)(method instanceof typescript_1.Method).toBe(true);
51
- (0, vitest_1.expect)(method.params).toStrictEqual(expectedMethod.params);
52
- (0, vitest_1.expect)(method.returnType).toStrictEqual(expectedMethod.returnType);
53
- (0, vitest_1.expect)(await formatTS(method.body)).toBe(await formatTS(expectedMethod.body));
48
+ ? expect(method instanceof typescript_1.StaticMethod).toBe(true)
49
+ : expect(method instanceof typescript_1.Method).toBe(true);
50
+ expect(method.params).toStrictEqual(expectedMethod.params);
51
+ expect(method.returnType).toStrictEqual(expectedMethod.returnType);
52
+ expect(formatTS(method.body)).toBe(formatTS(expectedMethod.body));
54
53
  }
55
- (0, vitest_1.expect)(methods.length).toBe(expectedEntity.methods.length);
54
+ expect(methods.length).toBe(expectedEntity.methods.length);
56
55
  };
57
- vitest_1.describe.concurrent('Schema code generator', () => {
58
- (0, vitest_1.test)('Should generate nothing for non entity types', () => {
56
+ describe('Schema code generator', () => {
57
+ test('Should generate nothing for non entity types', () => {
59
58
  const codegen = createSchemaCodeGen(`
60
59
  type Foo {
61
60
  foobar: Int
@@ -65,9 +64,9 @@ vitest_1.describe.concurrent('Schema code generator', () => {
65
64
  barfoo: Int
66
65
  }
67
66
  `);
68
- (0, vitest_1.expect)(codegen.generateTypes().length).toBe(0);
67
+ expect(codegen.generateTypes().length).toBe(0);
69
68
  });
70
- (0, vitest_1.describe)('Should generate correct classes for each entity', () => {
69
+ describe('Should generate correct classes for each entity', () => {
71
70
  const codegen = createSchemaCodeGen(`
72
71
  # just to be sure nothing will be generated from non-entity types alongside regular ones
73
72
  type Foo {
@@ -100,14 +99,14 @@ vitest_1.describe.concurrent('Schema code generator', () => {
100
99
  }
101
100
  `);
102
101
  const generatedTypes = codegen.generateTypes();
103
- (0, vitest_1.test)('Foo is NOT an entity', () => {
102
+ test('Foo is NOT an entity', () => {
104
103
  const foo = generatedTypes.find((type) => type.name === 'Foo');
105
- (0, vitest_1.expect)(foo).toBe(undefined);
104
+ expect(foo).toBe(undefined);
106
105
  // Account and Wallet
107
- (0, vitest_1.expect)(generatedTypes.length).toBe(2);
106
+ expect(generatedTypes.length).toBe(2);
108
107
  });
109
- (0, vitest_1.test)('Account is an entity with the correct methods', async () => {
110
- await testEntity(generatedTypes, {
108
+ test('Account is an entity with the correct methods', () => {
109
+ testEntity(generatedTypes, {
111
110
  name: 'Account',
112
111
  members: [],
113
112
  methods: [
@@ -309,8 +308,8 @@ vitest_1.describe.concurrent('Schema code generator', () => {
309
308
  ],
310
309
  });
311
310
  });
312
- (0, vitest_1.test)('Wallet is an entity with the correct methods', async () => {
313
- await testEntity(generatedTypes, {
311
+ test('Wallet is an entity with the correct methods', () => {
312
+ testEntity(generatedTypes, {
314
313
  name: 'Wallet',
315
314
  members: [],
316
315
  methods: [
@@ -420,7 +419,7 @@ vitest_1.describe.concurrent('Schema code generator', () => {
420
419
  });
421
420
  });
422
421
  });
423
- (0, vitest_1.test)('Should handle references with Bytes id types', async () => {
422
+ test('Should handle references with Bytes id types', () => {
424
423
  const codegen = createSchemaCodeGen(`
425
424
  interface Employee {
426
425
  id: Bytes!
@@ -441,7 +440,7 @@ vitest_1.describe.concurrent('Schema code generator', () => {
441
440
  }
442
441
  `);
443
442
  const generatedTypes = codegen.generateTypes();
444
- await testEntity(generatedTypes, {
443
+ testEntity(generatedTypes, {
445
444
  name: 'Task',
446
445
  members: [],
447
446
  methods: [
@@ -543,7 +542,7 @@ vitest_1.describe.concurrent('Schema code generator', () => {
543
542
  ],
544
543
  });
545
544
  });
546
- (0, vitest_1.test)('get related method for WithBytes entity', async () => {
545
+ test('get related method for WithBytes entity', () => {
547
546
  const codegen = createSchemaCodeGen(`
548
547
  type WithBytes @entity {
549
548
  id: Bytes!
@@ -556,7 +555,7 @@ vitest_1.describe.concurrent('Schema code generator', () => {
556
555
  }
557
556
  `);
558
557
  const generatedTypes = codegen.generateTypes();
559
- await testEntity(generatedTypes, {
558
+ testEntity(generatedTypes, {
560
559
  name: 'WithBytes',
561
560
  members: [],
562
561
  methods: [
@@ -623,7 +622,7 @@ vitest_1.describe.concurrent('Schema code generator', () => {
623
622
  ],
624
623
  });
625
624
  });
626
- (0, vitest_1.test)('no derived loader for interface', () => {
625
+ test('no derived loader for interface', () => {
627
626
  const codegen = createSchemaCodeGen(`
628
627
  interface IExample {
629
628
  id: ID!