Skip to content

Commit b9f82c3

Browse files
authored
Merge pull request #15 from tenex-engineering/develop
v0.11.0-alpha
2 parents 7cdaf67 + 974d615 commit b9f82c3

File tree

7 files changed

+43
-12
lines changed

7 files changed

+43
-12
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# graphql-x
22

3+
## 0.11.0
4+
5+
### Minor Changes
6+
7+
- c404bb4: refactor: remove prettier from production build
8+
39
## 0.10.1
410

511
### Patch Changes

eslint.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,14 @@ export default [
6161
],
6262
},
6363
},
64+
65+
{
66+
files: ['src/**/*'],
67+
rules: {
68+
'import/no-extraneous-dependencies': [
69+
'error',
70+
{ devDependencies: ['src/**/*.spec.*', 'src/testing/**/*'] },
71+
],
72+
},
73+
},
6474
]

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"watch:test": "vitest --exclude=\"**/*.integration.spec.*\" --coverage --clearScreen=false"
1515
},
1616
"name": "@txe/graphql-x",
17-
"version": "0.10.1",
17+
"version": "0.11.0",
1818
"description": "GraphQL eXpansion",
1919
"license": "MIT",
2020
"author": "Chabib N. R. <[email protected]> (https://tenex.engineering)",
@@ -48,8 +48,7 @@
4848
"dependencies": {
4949
"@parcel/watcher": "^2.5.0",
5050
"debounce": "^2.2.0",
51-
"graphql": "^16.9.0",
52-
"prettier": "^3.3.3"
51+
"graphql": "^16.9.0"
5352
},
5453
"devDependencies": {
5554
"@arethetypeswrong/cli": "0.17.0",
@@ -68,6 +67,7 @@
6867
"eslint-plugin-import": "^2.31.0",
6968
"eslint-plugin-unicorn": "^56.0.0",
7069
"globals": "^15.12.0",
70+
"prettier": "^3.3.3",
7171
"typescript": "^5.6.3",
7272
"typescript-eslint": "^8.14.0",
7373
"vite": "^5.4.11",

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cli.integration.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { exec as _exec } from 'node:child_process'
44
import expandedSchema from './fixtures/expanded.graphql?raw'
55
import { expect } from 'vitest'
66
import { fileURLToPath } from 'node:url'
7+
import { invoke } from '#app/utils/invoke.js'
78
import path from 'node:path'
9+
import * as prettier from 'prettier'
810
import { promisify } from 'node:util'
911
import { readFile } from 'node:fs/promises'
1012
import { rm } from 'node:fs/promises'
@@ -23,7 +25,14 @@ test('cli', async () => {
2325
await exec('npm run build')
2426
await exec(`npx graphql-x --schema ${schemaPath} --output ${outputPath}`)
2527

26-
const result = await readFile(outputPath, { encoding: 'utf-8' })
28+
const result = await invoke(async () => {
29+
let x
30+
31+
x = await readFile(outputPath, { encoding: 'utf-8' })
32+
x = await prettier.format(x, { parser: 'graphql' })
33+
34+
return x
35+
})
2736

2837
expect(result).toBe(expandedSchema)
2938
})

src/expand.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@ import { expand } from './expand.js'
22
import expandedSchema from './fixtures/expanded.graphql?raw'
33
import { expect } from 'vitest'
44
import initialSchema from './fixtures/initial.graphql?raw'
5+
import { invoke } from '#app/utils/invoke.js'
6+
import * as prettier from 'prettier'
57
import { test } from 'vitest'
68

79
test('expand', async () => {
8-
const result = await expand(initialSchema)
10+
const result = await invoke(async () => {
11+
let x
12+
13+
x = await expand(initialSchema)
14+
x = await prettier.format(x, { parser: 'graphql' })
15+
16+
return x
17+
})
918

1019
expect(result).toBe(expandedSchema)
1120
})

src/expand.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import cleanup from '#app/cleanup/index.js'
22
import type { Document } from '#app/types/document.js'
33
import { Kind } from 'graphql'
44
import { parse } from 'graphql'
5-
import * as prettier from 'prettier'
65
import { print } from 'graphql'
76

87
export async function expand(schema: string) {
@@ -50,7 +49,5 @@ export async function expand(schema: string) {
5049
),
5150
].join('\n\n')
5251

53-
const formatted = await prettier.format(result, { parser: 'graphql' })
54-
55-
return formatted
52+
return result
5653
}

0 commit comments

Comments
 (0)