@toptal/davinci-graphql-codegen 2.0.2 → 2.0.3-alpha-fx-4080-generated-502ca611.7
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/davinci-graphql-codegen",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3-alpha-fx-4080-generated-502ca611.7+502ca611",
|
|
4
4
|
"description": "Codegen",
|
|
5
5
|
"author": "Toptal",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.MD",
|
|
@@ -36,15 +36,15 @@
|
|
|
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-typed-document-node/core": "^3.2.0",
|
|
40
39
|
"@graphql-tools/url-loader": "^7.17.14",
|
|
40
|
+
"@graphql-typed-document-node/core": "^3.2.0",
|
|
41
|
+
"@toptal/davinci-cli-shared": "2.3.3-alpha-fx-4080-generated-502ca611.13+502ca611",
|
|
42
|
+
"@toptal/davinci-monorepo": "8.2.3-alpha-fx-4080-generated-502ca611.13+502ca611",
|
|
41
43
|
"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
|
-
"glob": "^8.0.3",
|
|
47
46
|
"fs-extra": "^11.1.1",
|
|
47
|
+
"glob": "^8.0.3",
|
|
48
48
|
"lodash.castarray": "^4.4.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
@@ -52,8 +52,9 @@
|
|
|
52
52
|
"prettier": "^2.6.2"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
+
"@jest/globals": "^29.4.2",
|
|
55
56
|
"graphql": "^16",
|
|
56
|
-
"prettier": "^2.6.2"
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
"prettier": "^2.6.2"
|
|
58
|
+
},
|
|
59
|
+
"gitHead": "502ca6115053cb43811ea4940e18805e3eea0c4e"
|
|
59
60
|
}
|
|
@@ -9,9 +9,9 @@ import getRelativeFilePath from '../utils/get-relative-file-path.js'
|
|
|
9
9
|
* @param path
|
|
10
10
|
* @returns {Promise<*>}
|
|
11
11
|
* @example
|
|
12
|
-
*
|
|
12
|
+
* importCodegenConfig('./codegen.json')
|
|
13
13
|
*/
|
|
14
|
-
export const
|
|
14
|
+
export const importCodegenConfig = async path => {
|
|
15
15
|
try {
|
|
16
16
|
const localRequire = createRequire(import.meta.url)
|
|
17
17
|
|
|
@@ -57,7 +57,7 @@ const readConfig = async config => {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
try {
|
|
60
|
-
return toArray(await
|
|
60
|
+
return toArray(await importCodegenConfig(codegenPath))
|
|
61
61
|
} catch (error) {
|
|
62
62
|
console.log(error)
|
|
63
63
|
throw new Error(`❌ There is no ${chalk.bold(configFileName)} file`)
|
|
@@ -14,9 +14,9 @@ jest.unstable_mockModule(configPathToESM, () => mockESMConfig, {
|
|
|
14
14
|
virtual: true,
|
|
15
15
|
})
|
|
16
16
|
|
|
17
|
-
const {
|
|
17
|
+
const { importCodegenConfig } = await import('./read-config.js')
|
|
18
18
|
|
|
19
|
-
describe('
|
|
19
|
+
describe('importCodegenConfig', () => {
|
|
20
20
|
afterEach(() => {
|
|
21
21
|
jest.resetModules()
|
|
22
22
|
})
|
|
@@ -25,7 +25,7 @@ describe('importCodgenConfig', () => {
|
|
|
25
25
|
it('should return the imported module', async () => {
|
|
26
26
|
jest.mock(configPathToCJS, () => config, { virtual: true })
|
|
27
27
|
|
|
28
|
-
const result = await
|
|
28
|
+
const result = await importCodegenConfig(configPathToCJS)
|
|
29
29
|
|
|
30
30
|
expect(result).toEqual(config)
|
|
31
31
|
})
|
|
@@ -45,7 +45,7 @@ describe('importCodgenConfig', () => {
|
|
|
45
45
|
{ virtual: true }
|
|
46
46
|
)
|
|
47
47
|
|
|
48
|
-
const result = await
|
|
48
|
+
const result = await importCodegenConfig(configPathToESM)
|
|
49
49
|
|
|
50
50
|
expect(result).toEqual(mockESMConfig.default)
|
|
51
51
|
})
|
|
@@ -67,7 +67,7 @@ describe('importCodgenConfig', () => {
|
|
|
67
67
|
|
|
68
68
|
mockESMConfig.default = undefined
|
|
69
69
|
|
|
70
|
-
await expect(
|
|
70
|
+
await expect(importCodegenConfig(configPathToESM)).rejects.toThrow(
|
|
71
71
|
'codegen has no default export'
|
|
72
72
|
)
|
|
73
73
|
})
|
|
@@ -85,7 +85,7 @@ describe('importCodgenConfig', () => {
|
|
|
85
85
|
{ virtual: true }
|
|
86
86
|
)
|
|
87
87
|
|
|
88
|
-
await expect(
|
|
88
|
+
await expect(importCodegenConfig(configPathToESM)).rejects.toThrow(
|
|
89
89
|
'mock import error'
|
|
90
90
|
)
|
|
91
91
|
})
|