@toptal/davinci-graphql-codegen 2.0.2-alpha-fx-4084-multiple-document-entries-b8f36a67.6 → 2.0.2

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,12 @@
1
1
  # @toptal/davinci-graphql-codegen
2
2
 
3
+ ## 2.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2042](https://github.com/toptal/davinci/pull/2042) [`2c37ef6e`](https://github.com/toptal/davinci/commit/2c37ef6e1958a00243f5f3f2df6e3e67d43b1826) Thanks [@dependabot](https://github.com/apps/dependabot)!
8
+ - dependencies update (`@babel/plugin-syntax-typescript`)
9
+
3
10
  ## 2.0.1
4
11
 
5
12
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-graphql-codegen",
3
- "version": "2.0.2-alpha-fx-4084-multiple-document-entries-b8f36a67.6+b8f36a67",
3
+ "version": "2.0.2",
4
4
  "description": "Codegen",
5
5
  "author": "Toptal",
6
6
  "license": "SEE LICENSE IN LICENSE.MD",
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@babel/core": "7.x",
27
27
  "@babel/parser": "^7.20.5",
28
- "@babel/plugin-syntax-typescript": "^7.20.0",
28
+ "@babel/plugin-syntax-typescript": "^7.22.5",
29
29
  "@babel/traverse": "^7.20.5",
30
30
  "@google-cloud/storage": "^6.2.3",
31
31
  "@graphql-codegen/add": "^3.2.1",
@@ -36,25 +36,24 @@
36
36
  "@graphql-codegen/typescript": "^2.2.2",
37
37
  "@graphql-codegen/typescript-operations": "^2.3.5",
38
38
  "@graphql-codegen/typescript-resolvers": "^2.2.1",
39
- "@graphql-tools/url-loader": "^7.17.14",
40
39
  "@graphql-typed-document-node/core": "^3.2.0",
41
- "@toptal/davinci-cli-shared": "2.3.3-alpha-fx-4084-multiple-document-entries-b8f36a67.6+b8f36a67",
42
- "@toptal/davinci-monorepo": "8.2.3-alpha-fx-4084-multiple-document-entries-b8f36a67.6+b8f36a67",
40
+ "@graphql-tools/url-loader": "^7.17.14",
43
41
  "babel-plugin-extract-export": "^0.1.0",
42
+ "@toptal/davinci-cli-shared": "^2.3.2",
43
+ "@toptal/davinci-monorepo": "8.2.2",
44
44
  "chalk": "^4.1.2",
45
45
  "deepmerge": "^4.2.2",
46
- "fs-extra": "^11.1.1",
47
46
  "glob": "^8.0.3",
48
- "lodash": "^4.17.21"
47
+ "fs-extra": "^11.1.1",
48
+ "lodash.castarray": "^4.4.0"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "graphql": "^16",
52
52
  "prettier": "^2.6.2"
53
53
  },
54
54
  "devDependencies": {
55
- "@jest/globals": "^29.4.2",
56
55
  "graphql": "^16",
57
- "prettier": "^2.6.2"
58
- },
59
- "gitHead": "b8f36a670b663ec5d1a824c0cf122ccf05245e06"
56
+ "prettier": "^2.6.2",
57
+ "@jest/globals": "^29.4.2"
58
+ }
60
59
  }
@@ -15,7 +15,11 @@ const codegenGenerateOperations = async ({
15
15
 
16
16
  const codegen = await readConfig(config)
17
17
 
18
- for (const { schema, documents, config: customConfig = {} } of codegen) {
18
+ for await (const {
19
+ schema,
20
+ documents,
21
+ config: customConfig = {},
22
+ } of codegen) {
19
23
  await generateOperations({
20
24
  schema,
21
25
  documents,
@@ -6,7 +6,7 @@ import readConfig from '../read-config/index.js'
6
6
  const codegenGenerateSchema = async ({ projectId, config }) => {
7
7
  const codegen = await readConfig(config)
8
8
 
9
- for (const { schema, documents, target } of codegen) {
9
+ for await (const { schema, documents, target } of codegen) {
10
10
  await generateSchema({
11
11
  schema,
12
12
  documents,
@@ -3,7 +3,6 @@ import { generate } from '@graphql-codegen/cli'
3
3
  import fsExtra from 'fs-extra'
4
4
  import prettier from 'prettier'
5
5
  import { dirname } from 'path'
6
- import { castArray } from 'lodash'
7
6
 
8
7
  import {
9
8
  commonOperationTypesConfig,
@@ -11,7 +10,7 @@ import {
11
10
  } from '../config/config.js'
12
11
  import getSchemaPath from '../services/get-schema-path.js'
13
12
  import getRelativeFilePath from '../utils/get-relative-file-path.js'
14
- import { plugin as fragmentImportResolverGraphQL } from '../extensions/fragment-import-resolver/graphql/index.js'
13
+ import { plugin as fragmetImportResolverGraphQL } from '../extensions/fragment-import-resolver/graphql/index.js'
15
14
 
16
15
  const { readFileSync, writeFileSync } = fsExtra
17
16
 
@@ -35,7 +34,7 @@ const generateOperations = async ({
35
34
  const isFragmentResolverExperimentEnabled =
36
35
  enabledExperiments.includes('fragment-resolver')
37
36
 
38
- const docsPath = castArray(documents).map(getRelativeFilePath)
37
+ const docsPath = getRelativeFilePath(documents)
39
38
 
40
39
  const { target, schemaPath, schemaPathResolution } = getSchemaPath(schema)
41
40
 
@@ -45,7 +44,7 @@ const generateOperations = async ({
45
44
  await generate(
46
45
  {
47
46
  documents: isFragmentResolverExperimentEnabled
48
- ? docsPath.flatMap(fragmentImportResolverGraphQL)
47
+ ? fragmetImportResolverGraphQL(docsPath)
49
48
  : docsPath,
50
49
  config: {
51
50
  ...commonOperationTypesConfig,
@@ -1,6 +1,6 @@
1
1
  import chalk from 'chalk'
2
2
  import { createRequire } from 'module'
3
- import { castArray as toArray } from 'lodash'
3
+ import toArray from 'lodash.castarray'
4
4
 
5
5
  import getRelativeFilePath from '../utils/get-relative-file-path.js'
6
6