Skip to content

Commit 7c99c7f

Browse files
chore(release): update monorepo packages versions
1 parent 90229a5 commit 7c99c7f

5 files changed

Lines changed: 62 additions & 29 deletions

File tree

‎.changeset/content-comparison-disk.md‎

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎packages/graphql-codegen-cli/CHANGELOG.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
# @graphql-codegen/cli
22

3+
## 7.4.0
4+
5+
### Minor Changes
6+
7+
- [#10928](https://github.com/dotansimha/graphql-code-generator/pull/10928)
8+
[`90229a5`](https://github.com/dotansimha/graphql-code-generator/commit/90229a5406ffeaa16422a0172340fcb53b94b1b9)
9+
Thanks [@eddeee888](https://github.com/eddeee888)! - Add
10+
`contentComparison?: 'cache-first' | 'disk'` to control disk-vs-cache write comparison in watch
11+
mode.
12+
13+
In watch mode the CLI caches the hash of the content it last wrote per file and compares new
14+
output against that cached hash to skip redundant writes. This assumes generated output is a pure
15+
function of the codegen inputs. An output whose content depends on the file's existing content
16+
(e.g. a preset that reads the file and rewrites part of it) breaks that assumption: if the file is
17+
changed on disk and codegen regenerates content identical to a previous run, the cached hash still
18+
matches and the write is skipped, so the on-disk change is never corrected.
19+
20+
`contentComparison: 'disk'` opts an output into comparing the generated content against the file
21+
on disk instead of the in-memory record of what codegen last wrote, so the file is rewritten when
22+
it was changed externally. It can be set:
23+
- by a preset, on the `GenerateOptions` it returns from `buildGeneratesSection`, or
24+
- on the output config (`generates[output].contentComparison`) for any output, including plain
25+
plugin outputs without a preset.
26+
27+
When both are present, the preset's value takes precedence. The default, `'cache-first'`, keeps
28+
the existing in-memory-cache behaviour for outputs that are a pure function of their inputs.
29+
30+
### Patch Changes
31+
32+
- Updated dependencies
33+
[[`90229a5`](https://github.com/dotansimha/graphql-code-generator/commit/90229a5406ffeaa16422a0172340fcb53b94b1b9)]:
34+
- @graphql-codegen/plugin-helpers@7.3.0
35+
336
## 7.3.1
437

538
### Patch Changes

‎packages/graphql-codegen-cli/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphql-codegen/cli",
3-
"version": "7.3.1",
3+
"version": "7.4.0",
44
"type": "module",
55
"repository": {
66
"type": "git",

‎packages/utils/plugins-helpers/CHANGELOG.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# @graphql-codegen/plugin-helpers
22

3+
## 7.3.0
4+
5+
### Minor Changes
6+
7+
- [#10928](https://github.com/dotansimha/graphql-code-generator/pull/10928)
8+
[`90229a5`](https://github.com/dotansimha/graphql-code-generator/commit/90229a5406ffeaa16422a0172340fcb53b94b1b9)
9+
Thanks [@eddeee888](https://github.com/eddeee888)! - Add
10+
`contentComparison?: 'cache-first' | 'disk'` to control disk-vs-cache write comparison in watch
11+
mode.
12+
13+
In watch mode the CLI caches the hash of the content it last wrote per file and compares new
14+
output against that cached hash to skip redundant writes. This assumes generated output is a pure
15+
function of the codegen inputs. An output whose content depends on the file's existing content
16+
(e.g. a preset that reads the file and rewrites part of it) breaks that assumption: if the file is
17+
changed on disk and codegen regenerates content identical to a previous run, the cached hash still
18+
matches and the write is skipped, so the on-disk change is never corrected.
19+
20+
`contentComparison: 'disk'` opts an output into comparing the generated content against the file
21+
on disk instead of the in-memory record of what codegen last wrote, so the file is rewritten when
22+
it was changed externally. It can be set:
23+
- by a preset, on the `GenerateOptions` it returns from `buildGeneratesSection`, or
24+
- on the output config (`generates[output].contentComparison`) for any output, including plain
25+
plugin outputs without a preset.
26+
27+
When both are present, the preset's value takes precedence. The default, `'cache-first'`, keeps
28+
the existing in-memory-cache behaviour for outputs that are a pure function of their inputs.
29+
330
## 7.2.1
431

532
### Patch Changes

‎packages/utils/plugins-helpers/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphql-codegen/plugin-helpers",
3-
"version": "7.2.1",
3+
"version": "7.3.0",
44
"type": "module",
55
"description": "GraphQL Code Generator common utils and types",
66
"repository": {

0 commit comments

Comments
 (0)