@graphql-codegen/cli 2.7.0-alpha-8791d9688.0 → 2.7.1-alpha-23dfe4aea.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.
Files changed (83) hide show
  1. package/cjs/bin.js +13 -0
  2. package/cjs/cli.js +60 -0
  3. package/cjs/codegen.js +344 -0
  4. package/cjs/config.js +303 -0
  5. package/cjs/generate-and-save.js +110 -0
  6. package/cjs/graphql-config.js +69 -0
  7. package/cjs/hooks.js +87 -0
  8. package/cjs/index.js +13 -0
  9. package/cjs/init/helpers.js +64 -0
  10. package/cjs/init/index.js +60 -0
  11. package/cjs/init/plugins.js +163 -0
  12. package/cjs/init/questions.js +147 -0
  13. package/cjs/init/targets.js +44 -0
  14. package/cjs/init/types.js +14 -0
  15. package/cjs/load.js +93 -0
  16. package/cjs/package.json +1 -0
  17. package/cjs/plugins.js +45 -0
  18. package/cjs/presets.js +50 -0
  19. package/cjs/utils/cli-error.js +25 -0
  20. package/cjs/utils/debugging.js +27 -0
  21. package/cjs/utils/file-system.js +26 -0
  22. package/cjs/utils/get-latest-version.js +15 -0
  23. package/cjs/utils/indentString.js +37 -0
  24. package/cjs/utils/listr-renderer.js +136 -0
  25. package/cjs/utils/logger.js +25 -0
  26. package/cjs/utils/watcher.js +140 -0
  27. package/esm/bin.js +11 -0
  28. package/esm/cli.js +32 -0
  29. package/esm/codegen.js +339 -0
  30. package/esm/config.js +290 -0
  31. package/esm/generate-and-save.js +105 -0
  32. package/esm/graphql-config.js +64 -0
  33. package/esm/hooks.js +83 -0
  34. package/esm/index.js +7 -0
  35. package/esm/init/helpers.js +55 -0
  36. package/esm/init/index.js +55 -0
  37. package/esm/init/plugins.js +160 -0
  38. package/esm/init/questions.js +140 -0
  39. package/esm/init/targets.js +40 -0
  40. package/esm/init/types.js +11 -0
  41. package/esm/load.js +88 -0
  42. package/esm/plugins.js +41 -0
  43. package/esm/presets.js +46 -0
  44. package/esm/utils/cli-error.js +20 -0
  45. package/esm/utils/debugging.js +21 -0
  46. package/esm/utils/file-system.js +19 -0
  47. package/esm/utils/get-latest-version.js +11 -0
  48. package/esm/utils/indentString.js +33 -0
  49. package/esm/utils/listr-renderer.js +130 -0
  50. package/esm/utils/logger.js +18 -0
  51. package/esm/utils/watcher.js +135 -0
  52. package/package.json +36 -28
  53. package/typings/bin.d.ts +2 -0
  54. package/{cli.d.ts → typings/cli.d.ts} +0 -0
  55. package/{codegen.d.ts → typings/codegen.d.ts} +1 -1
  56. package/{config.d.ts → typings/config.d.ts} +0 -0
  57. package/{generate-and-save.d.ts → typings/generate-and-save.d.ts} +1 -1
  58. package/{graphql-config.d.ts → typings/graphql-config.d.ts} +0 -0
  59. package/{hooks.d.ts → typings/hooks.d.ts} +0 -0
  60. package/typings/index.d.ts +7 -0
  61. package/{init → typings/init}/helpers.d.ts +1 -1
  62. package/{init → typings/init}/index.d.ts +0 -0
  63. package/{init → typings/init}/plugins.d.ts +1 -1
  64. package/{init → typings/init}/questions.d.ts +1 -1
  65. package/{init → typings/init}/targets.d.ts +1 -1
  66. package/{init → typings/init}/types.d.ts +0 -0
  67. package/{load.d.ts → typings/load.d.ts} +0 -0
  68. package/{plugins.d.ts → typings/plugins.d.ts} +0 -0
  69. package/{presets.d.ts → typings/presets.d.ts} +0 -0
  70. package/{utils → typings/utils}/cli-error.d.ts +0 -0
  71. package/{utils → typings/utils}/debugging.d.ts +0 -0
  72. package/{utils → typings/utils}/file-system.d.ts +0 -0
  73. package/typings/utils/get-latest-version.d.ts +6 -0
  74. package/{utils → typings/utils}/indentString.d.ts +0 -0
  75. package/{utils → typings/utils}/listr-renderer.d.ts +0 -0
  76. package/{utils → typings/utils}/logger.d.ts +0 -0
  77. package/{utils → typings/utils}/watcher.d.ts +1 -1
  78. package/bin.d.ts +0 -1
  79. package/bin.js +0 -1888
  80. package/index.d.ts +0 -7
  81. package/index.js +0 -1899
  82. package/index.mjs +0 -1855
  83. package/utils/try-to-build-schema.d.ts +0 -2
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
1
  {
2
2
  "name": "@graphql-codegen/cli",
3
- "version": "2.7.0-alpha-8791d9688.0",
3
+ "version": "2.7.1-alpha-23dfe4aea.0",
4
4
  "peerDependencies": {
5
5
  "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
6
6
  },
7
7
  "dependencies": {
8
8
  "@graphql-codegen/core": "2.5.1",
9
9
  "@graphql-codegen/plugin-helpers": "^2.4.1",
10
- "@graphql-tools/apollo-engine-loader": "^7.0.5",
11
- "@graphql-tools/code-file-loader": "^7.0.6",
12
- "@graphql-tools/git-loader": "^7.0.5",
13
- "@graphql-tools/github-loader": "^7.0.5",
14
- "@graphql-tools/graphql-file-loader": "^7.0.5",
15
- "@graphql-tools/json-file-loader": "^7.1.2",
16
- "@graphql-tools/load": "^7.3.0",
17
- "@graphql-tools/prisma-loader": "^7.0.6",
18
- "@graphql-tools/url-loader": "^7.0.11",
19
- "@graphql-tools/utils": "^8.1.1",
10
+ "@graphql-tools/apollo-engine-loader": "^7.3.1",
11
+ "@graphql-tools/code-file-loader": "^7.3.0",
12
+ "@graphql-tools/git-loader": "^7.2.0",
13
+ "@graphql-tools/github-loader": "^7.3.1",
14
+ "@graphql-tools/graphql-file-loader": "^7.4.0",
15
+ "@graphql-tools/json-file-loader": "^7.4.0",
16
+ "@graphql-tools/load": "^7.7.0",
17
+ "@graphql-tools/prisma-loader": "^7.2.2",
18
+ "@graphql-tools/url-loader": "^7.12.1",
19
+ "@graphql-tools/utils": "^8.8.0",
20
20
  "ansi-escapes": "^4.3.1",
21
21
  "chalk": "^4.1.0",
22
22
  "change-case-all": "1.0.14",
23
23
  "chokidar": "^3.5.2",
24
24
  "common-tags": "^1.8.0",
25
25
  "cosmiconfig": "^7.0.0",
26
+ "cross-undici-fetch": "^0.4.11",
26
27
  "debounce": "^1.2.0",
27
28
  "detect-indent": "^6.0.0",
28
- "graphql-config": "^4.1.0",
29
+ "graphql-config": "^4.3.1",
29
30
  "inquirer": "^8.0.0",
30
31
  "is-glob": "^4.0.1",
31
32
  "json-to-pretty-yaml": "^1.2.2",
32
- "latest-version": "5.1.0",
33
33
  "listr": "^0.14.3",
34
34
  "listr-update-renderer": "^0.5.0",
35
35
  "log-symbols": "^4.0.0",
@@ -65,26 +65,34 @@
65
65
  ],
66
66
  "author": "Dotan Simha <dotansimha@gmail.com>",
67
67
  "license": "MIT",
68
- "main": "index.js",
69
- "module": "index.mjs",
70
- "typings": "index.d.ts",
68
+ "main": "cjs/index.js",
69
+ "module": "esm/index.js",
70
+ "typings": "typings/index.d.ts",
71
71
  "typescript": {
72
- "definition": "index.d.ts"
72
+ "definition": "typings/index.d.ts"
73
73
  },
74
+ "type": "module",
74
75
  "exports": {
75
- "./package.json": "./package.json",
76
76
  ".": {
77
- "require": "./index.js",
78
- "import": "./index.mjs"
77
+ "require": {
78
+ "types": "./typings/index.d.ts",
79
+ "default": "./cjs/index.js"
80
+ },
81
+ "import": {
82
+ "types": "./typings/index.d.ts",
83
+ "default": "./esm/index.js"
84
+ },
85
+ "default": {
86
+ "types": "./typings/index.d.ts",
87
+ "default": "./esm/index.js"
88
+ }
79
89
  },
80
- "./*": {
81
- "require": "./*.js",
82
- "import": "./*.mjs"
83
- }
90
+ "./package.json": "./package.json"
84
91
  },
85
92
  "bin": {
86
- "gql-gen": "bin.js",
87
- "graphql-codegen": "bin.js",
88
- "graphql-code-generator": "bin.js"
93
+ "gql-gen": "cjs/bin.js",
94
+ "graphql-codegen": "cjs/bin.js",
95
+ "graphql-code-generator": "cjs/bin.js",
96
+ "graphql-codegen-esm": "esm/bin.js"
89
97
  }
90
- }
98
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
File without changes
@@ -1,3 +1,3 @@
1
1
  import { Types } from '@graphql-codegen/plugin-helpers';
2
- import { CodegenContext } from './config';
2
+ import { CodegenContext } from './config.js';
3
3
  export declare function executeCodegen(input: CodegenContext | Types.Config): Promise<Types.FileOutput[]>;
File without changes
@@ -1,5 +1,5 @@
1
1
  import { Types } from '@graphql-codegen/plugin-helpers';
2
- import { CodegenContext } from './config';
2
+ import { CodegenContext } from './config.js';
3
3
  export declare function generate(input: CodegenContext | (Types.Config & {
4
4
  cwd?: string;
5
5
  }), saveToFile?: boolean): Promise<Types.FileOutput[] | any>;
File without changes
@@ -0,0 +1,7 @@
1
+ export { executeCodegen } from './codegen.js';
2
+ export { generate } from './generate-and-save.js';
3
+ export * from './config.js';
4
+ export * from './init/index.js';
5
+ export * from './utils/cli-error.js';
6
+ export * from './cli.js';
7
+ export * from './graphql-config.js';
@@ -1,5 +1,5 @@
1
1
  import { Types } from '@graphql-codegen/plugin-helpers';
2
- import { Answers } from './types';
2
+ import { Answers } from './types.js';
3
3
  export declare function writeConfig(answers: Answers, config: Types.Config): Promise<{
4
4
  relativePath: string;
5
5
  fullPath: string;
File without changes
@@ -1,2 +1,2 @@
1
- import { PluginOption } from './types';
1
+ import { PluginOption } from './types.js';
2
2
  export declare const plugins: Array<PluginOption>;
@@ -1,5 +1,5 @@
1
1
  import inquirer from 'inquirer';
2
- import { Tags, Answers } from './types';
2
+ import { Tags, Answers } from './types.js';
3
3
  export declare function getQuestions(possibleTargets: Record<Tags, boolean>): inquirer.QuestionCollection;
4
4
  export declare function getApplicationTypeChoices(possibleTargets: Record<Tags, boolean>): {
5
5
  name: string;
@@ -1,2 +1,2 @@
1
- import { Tags } from './types';
1
+ import { Tags } from './types.js';
2
2
  export declare function guessTargets(): Promise<Record<Tags, boolean>>;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Fetches the version directly from the registry instead of depending on
3
+ * an ESM only module as latest-version does.
4
+ * @param packageName
5
+ */
6
+ export declare function getLatestVersion(packageName: string): Promise<string>;
File without changes
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  import { Types } from '@graphql-codegen/plugin-helpers';
2
- import { CodegenContext } from '../config';
2
+ import { CodegenContext } from '../config.js';
3
3
  export declare const createWatcher: (initalContext: CodegenContext, onNext: (result: Types.FileOutput[]) => Promise<Types.FileOutput[]>) => Promise<void>;
package/bin.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};