@toptal/davinci-graphql-codegen 2.1.0 → 3.1.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,5 +1,20 @@
1
1
  # @toptal/davinci-graphql-codegen
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2067](https://github.com/toptal/davinci/pull/2067) [`43574b79`](https://github.com/toptal/davinci/commit/43574b79e9a2603b6dafab8258532505e81c8679) Thanks [@ertrzyiks](https://github.com/ertrzyiks)!
8
+ - enable davinci-graphql-codegen-extensions by default
9
+
10
+ ## 3.0.0
11
+
12
+ ### Major Changes
13
+
14
+ - [#2060](https://github.com/toptal/davinci/pull/2060) [`739fdd3b`](https://github.com/toptal/davinci/commit/739fdd3b38c0d541738872d6e1878e2ba1efbb13) Thanks [@TomasSlama](https://github.com/TomasSlama)!
15
+ - change the default value of `--extension` for generated operations from `.ts` to `.generated.ts`
16
+ - use codemod to remove old files and replace imports `npx @toptal/davinci-codemod@ run-codemod davinci-graphql-codegen/3.0.0`
17
+
3
18
  ## 2.1.0
4
19
 
5
20
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-graphql-codegen",
3
- "version": "2.1.0",
3
+ "version": "3.1.0",
4
4
  "description": "Codegen",
5
5
  "author": "Toptal",
6
6
  "license": "SEE LICENSE IN LICENSE.MD",
@@ -41,6 +41,7 @@
41
41
  "@toptal/davinci-cli-shared": "^2.3.2",
42
42
  "@toptal/davinci-monorepo": "8.2.2",
43
43
  "babel-plugin-extract-export": "^0.1.0",
44
+ "@toptal/davinci-graphql-codegen-extensions": "1.0.3",
44
45
  "chalk": "^4.1.2",
45
46
  "deepmerge": "^4.2.2",
46
47
  "fs-extra": "^11.1.1",
@@ -29,7 +29,7 @@ exports[`generateOperations generates graphql operation types based off generate
29
29
  "short": "-e",
30
30
  "long": "--extension",
31
31
  "negate": false,
32
- "defaultValue": ".ts",
32
+ "defaultValue": ".generated.ts",
33
33
  "hidden": false,
34
34
  "conflictsWith": []
35
35
  },
@@ -87,7 +87,7 @@ exports[`generateOperations generates graphql operation types based off generate
87
87
  "_scriptPath": null,
88
88
  "_name": "generate-operations",
89
89
  "_optionValues": {
90
- "extension": ".ts",
90
+ "extension": ".generated.ts",
91
91
  "schemaName": "schema",
92
92
  "verbose": false
93
93
  },
@@ -38,7 +38,7 @@ export const createGenerateOperationsCommand = program =>
38
38
  .option(
39
39
  '-e, --extension <extension>',
40
40
  'Custom extension that generated files will have',
41
- '.ts'
41
+ '.generated.ts'
42
42
  )
43
43
  .option(
44
44
  '-s, --schema-name <name>',
@@ -30,10 +30,16 @@ const generateSchema = async ({ schema, target, projectId }) => {
30
30
  [destinationPathTs]: {
31
31
  schema: isSchemaFromHttp(schema)
32
32
  ? schema
33
- : localRequire.resolve(schemaPath),
33
+ : {
34
+ [localRequire.resolve(schemaPath)]: {
35
+ loader:
36
+ '@toptal/davinci-graphql-codegen-extensions/schema-loader',
37
+ },
38
+ },
34
39
  plugins: [
35
40
  'typescript',
36
41
  'typescript-resolvers',
42
+ '@toptal/davinci-graphql-codegen-extensions/enums-plugin',
37
43
  {
38
44
  add: {
39
45
  content: autoGenerationComments,