@toptal/davinci-graphql-codegen 1.1.5-alpha-fix-incorrect-command-helper-6f2fa60b.9 → 1.2.1

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,30 @@
1
1
  # @toptal/davinci-graphql-codegen
2
2
 
3
+ ## 1.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`a4d9c107`](https://github.com/toptal/davinci/commit/a4d9c1079c35fdd92b61aea850ba758c9063c642)]:
8
+ - @toptal/davinci-monorepo@8.1.1
9
+
10
+ ## 1.2.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [#2007](https://github.com/toptal/davinci/pull/2007) [`f19d7255`](https://github.com/toptal/davinci/commit/f19d7255a05c0f39d9c184d8e740e2a0d616c846) Thanks [@denieler](https://github.com/denieler)!
15
+
16
+ ---
17
+
18
+ - allow full paths for schemas (ex. gs://gqlgw-introspection/platform/production/public_schema.graphql). Previously was allowed only gs://gqlgw-introspection/public_schema.graphql
19
+
20
+ ### Patch Changes
21
+
22
+ - [#2007](https://github.com/toptal/davinci/pull/2007) [`f19d7255`](https://github.com/toptal/davinci/commit/f19d7255a05c0f39d9c184d8e740e2a0d616c846) Thanks [@denieler](https://github.com/denieler)!
23
+
24
+ ---
25
+
26
+ - command was throwing error when experiments were not specified
27
+
3
28
  ## 1.1.4
4
29
 
5
30
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-graphql-codegen",
3
- "version": "1.1.5-alpha-fix-incorrect-command-helper-6f2fa60b.9+6f2fa60b",
3
+ "version": "1.2.1",
4
4
  "description": "Codegen",
5
5
  "author": "Toptal",
6
6
  "license": "ISC",
@@ -36,24 +36,23 @@
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.1.0",
41
- "@toptal/davinci-cli-shared": "2.3.1-alpha-fix-incorrect-command-helper-6f2fa60b.20+6f2fa60b",
42
- "@toptal/davinci-monorepo": "8.1.1-alpha-fix-incorrect-command-helper-6f2fa60b.9+6f2fa60b",
40
+ "@graphql-tools/url-loader": "^7.17.14",
43
41
  "babel-plugin-extract-export": "^0.1.0",
42
+ "@toptal/davinci-cli-shared": "^2.3.0",
43
+ "@toptal/davinci-monorepo": "8.1.1",
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
47
  "graphql": "^15.8.0",
48
+ "fs-extra": "^11.1.1",
49
49
  "lodash.castarray": "^4.4.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "prettier": "^2.6.2"
53
53
  },
54
54
  "devDependencies": {
55
- "@jest/globals": "^29.4.2",
56
- "prettier": "^2.6.2"
57
- },
58
- "gitHead": "6f2fa60b045dc38cf9dc22599d2d89d474a08567"
55
+ "prettier": "^2.6.2",
56
+ "@jest/globals": "^29.4.2"
57
+ }
59
58
  }
@@ -21,7 +21,7 @@ const generateOperations = async ({
21
21
  experiments,
22
22
  schemaName,
23
23
  }) => {
24
- const enabledExperiments = experiments.split(',')
24
+ const enabledExperiments = experiments ? experiments.split(',') : []
25
25
 
26
26
  enabledExperiments.forEach(exp => {
27
27
  console.log(
@@ -9,7 +9,7 @@ const parseGSURI = source => {
9
9
  if (typeof source !== 'string' || !source.startsWith('gs://')) {
10
10
  throw new Error('Invalid input: expected a string starting with gs://')
11
11
  }
12
- const regex = /^gs:\/\/(?<bucketName>[^/]+)\/(?<fileName>[^/]+)$/
12
+ const regex = /^gs:\/\/(?<bucketName>[^/]+)\/(?<fileName>.+\.(graphql|gql))$/
13
13
 
14
14
  const match = source.match(regex)
15
15
 
@@ -12,6 +12,18 @@ describe('parseGSURI', () => {
12
12
  expect(result).toEqual(expected)
13
13
  })
14
14
 
15
+ it('parses a valid GS URI with path including folders', () => {
16
+ const uri =
17
+ 'gs://gqlgw-introspection/some-folder/another-folder/staging_talent_schema.graphql'
18
+ const expected = {
19
+ bucketName: 'gqlgw-introspection',
20
+ fileName: 'some-folder/another-folder/staging_talent_schema.graphql',
21
+ }
22
+ const result = parseGSURI(uri)
23
+
24
+ expect(result).toEqual(expected)
25
+ })
26
+
15
27
  it('throws an error for an invalid input', () => {
16
28
  const uri = 'http://example.com'
17
29