@depup/graphql-codegen__plugin-helpers 7.2.0-depup.0 → 7.3.0-depup.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.
package/README.md CHANGED
@@ -13,8 +13,8 @@ npm install @depup/graphql-codegen__plugin-helpers
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [@graphql-codegen/plugin-helpers](https://www.npmjs.com/package/@graphql-codegen/plugin-helpers) @ 7.2.0 |
17
- | Processed | 2026-08-22 |
16
+ | Original | [@graphql-codegen/plugin-helpers](https://www.npmjs.com/package/@graphql-codegen/plugin-helpers) @ 7.3.0 |
17
+ | Processed | 2026-09-01 |
18
18
  | Smoke test | passed |
19
19
  | Deps updated | 2 |
20
20
 
package/changes.json CHANGED
@@ -9,6 +9,6 @@
9
9
  "to": "^2.8.1"
10
10
  }
11
11
  },
12
- "timestamp": "2026-08-22T08:07:17.292Z",
12
+ "timestamp": "2026-09-01T16:30:50.311Z",
13
13
  "totalUpdated": 2
14
14
  }
package/cjs/profiler.js CHANGED
@@ -4,20 +4,37 @@ exports.createNoopProfiler = createNoopProfiler;
4
4
  exports.createProfiler = createProfiler;
5
5
  function createNoopProfiler() {
6
6
  return {
7
+ outputName: null,
7
8
  run(fn) {
8
9
  return Promise.resolve().then(() => fn());
9
10
  },
10
11
  collect() {
11
12
  return [];
12
13
  },
14
+ clear() { },
13
15
  };
14
16
  }
15
17
  function createProfiler() {
18
+ /** Build a unique, human-readable trace filename e.g. `codegen-20111005T144800000.json` */
19
+ function generateOutputName() {
20
+ const datetimeNormalized = new Date()
21
+ .toISOString() // 2011-10-05T14:48:00.000Z
22
+ .replace(/[-:.Z]/g, ''); // 20111005T144800000
23
+ return `codegen-${datetimeNormalized}.json`;
24
+ }
16
25
  const events = [];
26
+ let outputName = generateOutputName();
17
27
  return {
28
+ get outputName() {
29
+ return outputName;
30
+ },
18
31
  collect() {
19
32
  return events;
20
33
  },
34
+ clear() {
35
+ events.length = 0;
36
+ outputName = generateOutputName();
37
+ },
21
38
  run(fn, name, cat) {
22
39
  let startTime;
23
40
  return Promise.resolve()
package/esm/profiler.js CHANGED
@@ -1,19 +1,36 @@
1
1
  export function createNoopProfiler() {
2
2
  return {
3
+ outputName: null,
3
4
  run(fn) {
4
5
  return Promise.resolve().then(() => fn());
5
6
  },
6
7
  collect() {
7
8
  return [];
8
9
  },
10
+ clear() { },
9
11
  };
10
12
  }
11
13
  export function createProfiler() {
14
+ /** Build a unique, human-readable trace filename e.g. `codegen-20111005T144800000.json` */
15
+ function generateOutputName() {
16
+ const datetimeNormalized = new Date()
17
+ .toISOString() // 2011-10-05T14:48:00.000Z
18
+ .replace(/[-:.Z]/g, ''); // 20111005T144800000
19
+ return `codegen-${datetimeNormalized}.json`;
20
+ }
12
21
  const events = [];
22
+ let outputName = generateOutputName();
13
23
  return {
24
+ get outputName() {
25
+ return outputName;
26
+ },
14
27
  collect() {
15
28
  return events;
16
29
  },
30
+ clear() {
31
+ events.length = 0;
32
+ outputName = generateOutputName();
33
+ },
17
34
  run(fn, name, cat) {
18
35
  let startTime;
19
36
  return Promise.resolve()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depup/graphql-codegen__plugin-helpers",
3
- "version": "7.2.0-depup.0",
3
+ "version": "7.3.0-depup.0",
4
4
  "description": "GraphQL Code Generator common utils and types (with updated dependencies)",
5
5
  "peerDependencies": {
6
6
  "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 || ^17.0.0"
@@ -66,8 +66,8 @@
66
66
  },
67
67
  "depsUpdated": 2,
68
68
  "originalPackage": "@graphql-codegen/plugin-helpers",
69
- "originalVersion": "7.2.0",
70
- "processedAt": "2026-08-22T08:07:20.698Z",
69
+ "originalVersion": "7.3.0",
70
+ "processedAt": "2026-09-01T16:30:52.613Z",
71
71
  "smokeTest": "passed"
72
72
  }
73
73
  }
@@ -21,8 +21,16 @@ export interface ProfilerEvent {
21
21
  cname?: string;
22
22
  }
23
23
  export interface Profiler {
24
+ /**
25
+ * Filename of the current trace's collected events should be written to,
26
+ * or `null` when profiling is disabled.
27
+ * A fresh name is generated whenever {@link clear} starts a new trace.
28
+ */
29
+ readonly outputName: string | null;
24
30
  run<T>(fn: () => Promise<T>, name: string, cat?: string): Promise<T>;
25
31
  collect(): ProfilerEvent[];
32
+ /** Discard all collected events so the next {@link collect} starts fresh */
33
+ clear(): void;
26
34
  }
27
35
  export declare function createNoopProfiler(): Profiler;
28
36
  export declare function createProfiler(): Profiler;
@@ -21,8 +21,16 @@ export interface ProfilerEvent {
21
21
  cname?: string;
22
22
  }
23
23
  export interface Profiler {
24
+ /**
25
+ * Filename of the current trace's collected events should be written to,
26
+ * or `null` when profiling is disabled.
27
+ * A fresh name is generated whenever {@link clear} starts a new trace.
28
+ */
29
+ readonly outputName: string | null;
24
30
  run<T>(fn: () => Promise<T>, name: string, cat?: string): Promise<T>;
25
31
  collect(): ProfilerEvent[];
32
+ /** Discard all collected events so the next {@link collect} starts fresh */
33
+ clear(): void;
26
34
  }
27
35
  export declare function createNoopProfiler(): Profiler;
28
36
  export declare function createProfiler(): Profiler;
@@ -3,6 +3,21 @@ import type { ApolloEngineOptions } from '@graphql-tools/apollo-engine-loader';
3
3
  import { Source } from '@graphql-tools/utils';
4
4
  import type { Profiler } from './profiler.cjs';
5
5
  export declare namespace Types {
6
+ /**
7
+ * @description Controls how the CLI decides whether the generated content already
8
+ * matches the output file so the write can be skipped:
9
+ *
10
+ * - `'cache-first'` (default): compare against the in-memory hash of what codegen
11
+ * last wrote, falling back to reading the file from disk when there is no cached
12
+ * entry. Assumes the output is a pure function of the codegen inputs.
13
+ * - `'disk'`: always compare against the file on disk. Use this when the output
14
+ * depends on the file's existing content (e.g. a preset that reads the file and
15
+ * rewrites part of it), so a file that was changed on disk is not wrongly skipped
16
+ * in watch mode.
17
+ *
18
+ * @default 'cache-first'
19
+ */
20
+ type ContentComparison = 'cache-first' | 'disk';
6
21
  interface GenerateOptions {
7
22
  filename: string;
8
23
  plugins: Types.ConfiguredPlugin[];
@@ -24,6 +39,11 @@ export declare namespace Types {
24
39
  documentTransforms?: ConfiguredDocumentTransform[];
25
40
  emitLegacyCommonJSImports?: boolean;
26
41
  importExtension?: '' | `.${string}`;
42
+ /**
43
+ * @description How the CLI compares generated content against the output file
44
+ * to decide whether the write can be skipped. See {@link Types.ContentComparison}.
45
+ */
46
+ contentComparison?: Types.ContentComparison;
27
47
  }
28
48
  type FileOutput = {
29
49
  filename: string;
@@ -32,6 +52,17 @@ export declare namespace Types {
32
52
  beforeOneFileWrite?: LifecycleHooksDefinition['beforeOneFileWrite'];
33
53
  afterOneFileWrite?: LifecycleHooksDefinition['afterOneFileWrite'];
34
54
  };
55
+ /**
56
+ * @description How the CLI compares generated content against the output file
57
+ * to decide whether the write can be skipped. See {@link Types.ContentComparison}.
58
+ */
59
+ contentComparison?: Types.ContentComparison;
60
+ /**
61
+ * @description Carries the `overwrite` setting from the `generates` entry that
62
+ * produced this file, so the CLI can honor it per file (e.g. a preset keyed by a
63
+ * directory, which can't be looked up by a generated file's path).
64
+ */
65
+ overwrite?: boolean | Partial<NormalizedOverwriteOption>;
35
66
  };
36
67
  interface DocumentFile extends Source {
37
68
  hash?: string | null;
@@ -258,6 +289,14 @@ export declare namespace Types {
258
289
  * For more details: https://graphql-code-generator.com/docs/config-reference/codegen-config
259
290
  */
260
291
  overwrite?: boolean | Partial<NormalizedOverwriteOption>;
292
+ /**
293
+ * @description How the CLI compares generated content against the output file
294
+ * to decide whether the write can be skipped. See {@link Types.ContentComparison}.
295
+ *
296
+ * A preset can also set this per output from `buildGeneratesSection`; the value
297
+ * returned there takes precedence over this one.
298
+ */
299
+ contentComparison?: Types.ContentComparison;
261
300
  /**
262
301
  * @description A pointer(s) to your GraphQL documents: query, mutation, subscription and fragment. These documents will be loaded into for all your output files.
263
302
  * You can use one of the following:
@@ -3,6 +3,21 @@ import type { ApolloEngineOptions } from '@graphql-tools/apollo-engine-loader';
3
3
  import { Source } from '@graphql-tools/utils';
4
4
  import type { Profiler } from './profiler.js';
5
5
  export declare namespace Types {
6
+ /**
7
+ * @description Controls how the CLI decides whether the generated content already
8
+ * matches the output file so the write can be skipped:
9
+ *
10
+ * - `'cache-first'` (default): compare against the in-memory hash of what codegen
11
+ * last wrote, falling back to reading the file from disk when there is no cached
12
+ * entry. Assumes the output is a pure function of the codegen inputs.
13
+ * - `'disk'`: always compare against the file on disk. Use this when the output
14
+ * depends on the file's existing content (e.g. a preset that reads the file and
15
+ * rewrites part of it), so a file that was changed on disk is not wrongly skipped
16
+ * in watch mode.
17
+ *
18
+ * @default 'cache-first'
19
+ */
20
+ type ContentComparison = 'cache-first' | 'disk';
6
21
  interface GenerateOptions {
7
22
  filename: string;
8
23
  plugins: Types.ConfiguredPlugin[];
@@ -24,6 +39,11 @@ export declare namespace Types {
24
39
  documentTransforms?: ConfiguredDocumentTransform[];
25
40
  emitLegacyCommonJSImports?: boolean;
26
41
  importExtension?: '' | `.${string}`;
42
+ /**
43
+ * @description How the CLI compares generated content against the output file
44
+ * to decide whether the write can be skipped. See {@link Types.ContentComparison}.
45
+ */
46
+ contentComparison?: Types.ContentComparison;
27
47
  }
28
48
  type FileOutput = {
29
49
  filename: string;
@@ -32,6 +52,17 @@ export declare namespace Types {
32
52
  beforeOneFileWrite?: LifecycleHooksDefinition['beforeOneFileWrite'];
33
53
  afterOneFileWrite?: LifecycleHooksDefinition['afterOneFileWrite'];
34
54
  };
55
+ /**
56
+ * @description How the CLI compares generated content against the output file
57
+ * to decide whether the write can be skipped. See {@link Types.ContentComparison}.
58
+ */
59
+ contentComparison?: Types.ContentComparison;
60
+ /**
61
+ * @description Carries the `overwrite` setting from the `generates` entry that
62
+ * produced this file, so the CLI can honor it per file (e.g. a preset keyed by a
63
+ * directory, which can't be looked up by a generated file's path).
64
+ */
65
+ overwrite?: boolean | Partial<NormalizedOverwriteOption>;
35
66
  };
36
67
  interface DocumentFile extends Source {
37
68
  hash?: string | null;
@@ -258,6 +289,14 @@ export declare namespace Types {
258
289
  * For more details: https://graphql-code-generator.com/docs/config-reference/codegen-config
259
290
  */
260
291
  overwrite?: boolean | Partial<NormalizedOverwriteOption>;
292
+ /**
293
+ * @description How the CLI compares generated content against the output file
294
+ * to decide whether the write can be skipped. See {@link Types.ContentComparison}.
295
+ *
296
+ * A preset can also set this per output from `buildGeneratesSection`; the value
297
+ * returned there takes precedence over this one.
298
+ */
299
+ contentComparison?: Types.ContentComparison;
261
300
  /**
262
301
  * @description A pointer(s) to your GraphQL documents: query, mutation, subscription and fragment. These documents will be loaded into for all your output files.
263
302
  * You can use one of the following: