@stepzen/transpiler 0.45.0-experimental.a6f5273 → 0.45.0-experimental.aa7017c

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.
Files changed (73) hide show
  1. package/LICENSE +1 -1
  2. package/lib/actions/configure.js +8 -10
  3. package/lib/actions/configure.js.map +1 -1
  4. package/lib/actions/lint.js +13 -15
  5. package/lib/actions/lint.js.map +1 -1
  6. package/lib/actions/merge.d.ts +1 -1
  7. package/lib/actions/merge.d.ts.map +1 -1
  8. package/lib/actions/merge.js +44 -46
  9. package/lib/actions/merge.js.map +1 -1
  10. package/lib/actions/print.js +5 -7
  11. package/lib/actions/print.js.map +1 -1
  12. package/lib/actions/stitch.js +24 -26
  13. package/lib/actions/stitch.js.map +1 -1
  14. package/lib/actions/transpile.js +19 -21
  15. package/lib/actions/transpile.js.map +1 -1
  16. package/lib/actions/validate.js +14 -16
  17. package/lib/actions/validate.js.map +1 -1
  18. package/lib/index.d.ts +7 -7
  19. package/lib/index.d.ts.map +1 -1
  20. package/lib/index.js +8 -18
  21. package/lib/index.js.map +1 -1
  22. package/lib/mutations/config/envvars.js +3 -5
  23. package/lib/mutations/config/envvars.js.map +1 -1
  24. package/lib/mutations/config/index.js +3 -5
  25. package/lib/mutations/config/index.js.map +1 -1
  26. package/lib/utils/constants.js +6 -9
  27. package/lib/utils/constants.js.map +1 -1
  28. package/lib/utils/copy-workspace-content.js +10 -14
  29. package/lib/utils/copy-workspace-content.js.map +1 -1
  30. package/lib/utils/dedupe-query-and-mutation-types.js +9 -11
  31. package/lib/utils/dedupe-query-and-mutation-types.js.map +1 -1
  32. package/lib/utils/ensure-query-and-mutation-types.js +7 -9
  33. package/lib/utils/ensure-query-and-mutation-types.js.map +1 -1
  34. package/lib/utils/graphql-helpers.d.ts +1 -1
  35. package/lib/utils/graphql-helpers.d.ts.map +1 -1
  36. package/lib/utils/graphql-helpers.js +2 -6
  37. package/lib/utils/graphql-helpers.js.map +1 -1
  38. package/lib/utils/merge-helpers.js +48 -62
  39. package/lib/utils/merge-helpers.js.map +1 -1
  40. package/lib/utils/rmtemp.js +7 -11
  41. package/lib/utils/rmtemp.js.map +1 -1
  42. package/lib/utils/set-files-in-sdl.d.ts +2 -3
  43. package/lib/utils/set-files-in-sdl.d.ts.map +1 -1
  44. package/lib/utils/set-files-in-sdl.js +40 -43
  45. package/lib/utils/set-files-in-sdl.js.map +1 -1
  46. package/lib/utils/strip-empty-queries-and-mutations.js +8 -10
  47. package/lib/utils/strip-empty-queries-and-mutations.js.map +1 -1
  48. package/lib/validators/config-exists/index.js +10 -12
  49. package/lib/validators/config-exists/index.js.map +1 -1
  50. package/lib/validators/index.js +3 -5
  51. package/lib/validators/index.js.map +1 -1
  52. package/package.json +16 -12
  53. package/src/actions/configure.ts +8 -8
  54. package/src/actions/lint.ts +8 -8
  55. package/src/actions/merge.ts +13 -13
  56. package/src/actions/print.ts +2 -2
  57. package/src/actions/stitch.ts +12 -12
  58. package/src/actions/transpile.ts +12 -12
  59. package/src/actions/validate.ts +7 -7
  60. package/src/index.ts +8 -8
  61. package/src/mutations/config/envvars.ts +2 -2
  62. package/src/mutations/config/index.ts +2 -2
  63. package/src/utils/constants.ts +3 -3
  64. package/src/utils/copy-workspace-content.ts +6 -6
  65. package/src/utils/dedupe-query-and-mutation-types.ts +2 -2
  66. package/src/utils/ensure-query-and-mutation-types.ts +2 -2
  67. package/src/utils/graphql-helpers.ts +4 -2
  68. package/src/utils/merge-helpers.ts +15 -15
  69. package/src/utils/rmtemp.ts +5 -5
  70. package/src/utils/set-files-in-sdl.ts +28 -22
  71. package/src/utils/strip-empty-queries-and-mutations.ts +2 -2
  72. package/src/validators/config-exists/index.ts +5 -5
  73. package/src/validators/index.ts +2 -2
package/package.json CHANGED
@@ -1,36 +1,36 @@
1
1
  {
2
2
  "name": "@stepzen/transpiler",
3
3
  "description": "The StepZen transpiler",
4
- "version": "0.45.0-experimental.a6f5273",
4
+ "version": "0.45.0-experimental.aa7017c",
5
5
  "author": "Darren Waddell <darren@stepzen.com>",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "lib/**/*",
9
9
  "src/**/*"
10
10
  ],
11
+ "type": "module",
11
12
  "main": "lib/index.js",
12
13
  "types": "lib/index.d.ts",
13
14
  "engines": {
14
- "node": ">=14.0.1",
15
- "npm": ">=6.14"
15
+ "node": ">=18.0"
16
16
  },
17
17
  "scripts": {
18
18
  "clean": "rm -rf lib tsconfig.tsbuildinfo",
19
- "build": "../../node_modules/.bin/tsc -b",
19
+ "build": "tsc -b",
20
20
  "test": "npm run build && nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
21
21
  "test:single": "npm run build && mocha",
22
22
  "posttest": "prettier . --check"
23
23
  },
24
24
  "dependencies": {
25
25
  "@graphql-tools/merge": "^8.3.15",
26
- "@stepzen/fetch": "0.45.0-experimental.a6f5273",
26
+ "@stepzen/fetch": "0.45.0-experimental.aa7017c",
27
27
  "debug": "^4.3.4",
28
28
  "dotenv": "^16.0.3",
29
29
  "fs-extra": "^9.1.0",
30
30
  "glob": "^7.2.3",
31
31
  "graphql": "^16.8.1",
32
32
  "inquirer": "^8.2.5",
33
- "lodash": "^4.17.21",
33
+ "lodash-es": "^4.17.21",
34
34
  "prettier": "^2.8.3",
35
35
  "shelljs": "^0.8.5",
36
36
  "yaml": "^2.2.2"
@@ -42,21 +42,25 @@
42
42
  "@types/glob": "^7.2.0",
43
43
  "@types/inquirer": "^8.2.5",
44
44
  "@types/license-checker": "^25.0.3",
45
- "@types/lodash": "^4.14.168",
46
- "@types/mocha": "^10.0.1",
45
+ "@types/lodash-es": "^4.17.12",
46
+ "@types/mocha": "^10.0.9",
47
47
  "@types/mock-fs": "^4.13.0",
48
- "@types/node": "^14.18.36",
49
48
  "@types/node-fetch": "^2.6.2",
50
49
  "@types/prettier": "^2.7.2",
51
50
  "@types/shelljs": "^0.8.11",
52
51
  "chai": "^4.3.10",
53
52
  "fancy-test": "^1.4.10",
54
53
  "license-checker": "^25.0.1",
55
- "mocha": "^10.2.0",
54
+ "mocha": "^10.8.2",
56
55
  "mock-fs": "^4.13.0",
57
56
  "node-ts": "^5.1.1",
58
57
  "nyc": "^15.1.0",
59
- "ts-node": "^10.8.2"
58
+ "ts-node": "^10.9.2",
59
+ "typescript": ">=5 <5.4"
60
60
  },
61
- "gitHead": "a6f527388119c84983ac5c1e93150f4403054b01"
61
+ "overrides": {
62
+ "--comment--": "workaround for CVE-2024-21538",
63
+ "cross-spawn": "^7.0.6"
64
+ },
65
+ "gitHead": "aa7017cebf412a7829e12158699ea14970b7b2d1"
62
66
  }
@@ -1,11 +1,11 @@
1
- // Copyright IBM Corp. 2020, 2024
2
-
3
- import * as debug from 'debug'
4
- import * as fsx from 'fs-extra'
5
- import * as glob from 'glob'
6
- import * as inquirer from 'inquirer'
7
- import * as path from 'path'
8
- import * as yaml from 'yaml'
1
+ // Copyright IBM Corp. 2020, 2025
2
+
3
+ import debug from 'debug'
4
+ import fsx from 'fs-extra'
5
+ import glob from 'glob'
6
+ import inquirer from 'inquirer'
7
+ import path from 'node:path'
8
+ import yaml from 'yaml'
9
9
 
10
10
  /**
11
11
  * Get effective StepZen endpoint configuration for a directory:
@@ -1,13 +1,13 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
- import * as fsx from 'fs-extra'
4
- import * as os from 'os'
5
- import * as path from 'path'
6
- import * as shell from 'shelljs'
3
+ import fsx from 'fs-extra'
4
+ import os from 'node:os'
5
+ import path from 'node:path'
6
+ import shell from 'shelljs'
7
7
 
8
- import stitch from '../actions/stitch'
9
- import {getExtensions} from '../utils/merge-helpers'
10
- import {rmtemp} from '../utils/rmtemp'
8
+ import stitch from '../actions/stitch.js'
9
+ import {getExtensions} from '../utils/merge-helpers.js'
10
+ import {rmtemp} from '../utils/rmtemp.js'
11
11
 
12
12
  export default async (
13
13
  source: string,
@@ -1,12 +1,12 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
- import * as fsx from 'fs-extra'
4
- import * as glob from 'glob'
3
+ import fsx from 'fs-extra'
4
+ import glob from 'glob'
5
5
  import {mergeTypeDefs} from '@graphql-tools/merge'
6
6
  import {parse, visit} from 'graphql'
7
- import * as os from 'os'
8
- import * as path from 'path'
9
- import * as yaml from 'yaml'
7
+ import os from 'node:os'
8
+ import path from 'node:path'
9
+ import yaml from 'yaml'
10
10
 
11
11
  import {
12
12
  dedupeTempFolder,
@@ -20,13 +20,13 @@ import {
20
20
  getConfiguration,
21
21
  findNextAvailableSubfolder,
22
22
  getExtensions,
23
- } from '../utils/merge-helpers'
24
- import print from './print'
25
- import setFilesInSDL from '../utils/set-files-in-sdl'
26
- import stripEmptyQueriesAndMutations from '../utils/strip-empty-queries-and-mutations'
27
- import copyWorkspaceContent from '../utils/copy-workspace-content'
28
- import {ALL_GRAPHQL_FILES} from '../utils/constants'
29
- import {rmtemp} from '../utils/rmtemp'
23
+ } from '../utils/merge-helpers.js'
24
+ import print from './print.js'
25
+ import setFilesInSDL from '../utils/set-files-in-sdl.js'
26
+ import stripEmptyQueriesAndMutations from '../utils/strip-empty-queries-and-mutations.js'
27
+ import copyWorkspaceContent from '../utils/copy-workspace-content.js'
28
+ import {ALL_GRAPHQL_FILES} from '../utils/constants.js'
29
+ import {rmtemp} from '../utils/rmtemp.js'
30
30
 
31
31
  // It's safe to use this special placeholder value here: in case of a failure
32
32
  // in the merge / import process it will not reach the workspace folder.
@@ -1,7 +1,7 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
3
  import {DocumentNode, print} from 'graphql'
4
- import * as prettier from 'prettier'
4
+ import prettier from 'prettier'
5
5
 
6
6
  export default (ast: DocumentNode): string => {
7
7
  const printed = print(ast)
@@ -1,17 +1,17 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
- import {clone, cloneDeep} from 'lodash'
3
+ import {clone, cloneDeep} from 'lodash-es'
4
4
  import {parse, print, visit} from 'graphql'
5
- import * as fsx from 'fs-extra'
6
- import * as glob from 'glob'
7
- import * as os from 'os'
8
- import * as path from 'path'
9
- import * as prettier from 'prettier'
10
-
11
- import dedupeQueryAndMutationTypes from '../utils/dedupe-query-and-mutation-types'
12
- import {ALL_GRAPHQL_FILES} from '../utils/constants'
13
- import {getAllGraphQLFiles} from '../utils/copy-workspace-content'
14
- import {rmtemp} from '../utils/rmtemp'
5
+ import fsx from 'fs-extra'
6
+ import glob from 'glob'
7
+ import os from 'node:os'
8
+ import path from 'node:path'
9
+ import prettier from 'prettier'
10
+
11
+ import dedupeQueryAndMutationTypes from '../utils/dedupe-query-and-mutation-types.js'
12
+ import {ALL_GRAPHQL_FILES} from '../utils/constants.js'
13
+ import {getAllGraphQLFiles} from '../utils/copy-workspace-content.js'
14
+ import {rmtemp} from '../utils/rmtemp.js'
15
15
 
16
16
  const doStitch = (source: string, output: string) => {
17
17
  // Ensure source and output directories exist
@@ -1,19 +1,19 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
3
  import {parse} from 'graphql'
4
- import * as dotenv from 'dotenv'
5
- import * as debug from 'debug'
6
- import * as fs from 'fs'
7
- import * as glob from 'glob'
8
- import * as path from 'path'
9
- import * as yaml from 'yaml'
4
+ import dotenv from 'dotenv'
5
+ import debug from 'debug'
6
+ import fs from 'node:fs'
7
+ import glob from 'glob'
8
+ import path from 'node:path'
9
+ import yaml from 'yaml'
10
10
 
11
- import print from '../actions/print'
12
- import stitch from '../actions/stitch'
13
- import configure from './configure'
11
+ import print from '../actions/print.js'
12
+ import stitch from '../actions/stitch.js'
13
+ import configure from './configure.js'
14
14
 
15
- import configMutations from '../mutations/config'
16
- import {rmtemp} from '../utils/rmtemp'
15
+ import configMutations from '../mutations/config/index.js'
16
+ import {rmtemp} from '../utils/rmtemp.js'
17
17
 
18
18
  /**
19
19
  * Read a StepZen workspace directory, apply StepZen-specific schema and config
@@ -1,13 +1,13 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
3
  import {buildASTSchema, DocumentNode, parse, print} from 'graphql'
4
- import * as fsx from 'fs-extra'
5
- import * as os from 'os'
6
- import * as path from 'path'
4
+ import fsx from 'fs-extra'
5
+ import os from 'node:os'
6
+ import path from 'node:path'
7
7
 
8
- import ensureQueryAndMutationTypes from '../utils/ensure-query-and-mutation-types'
9
- import {EXPERIMENTAL_EXTENSIONS} from '../utils/constants'
10
- import validators from '../validators'
8
+ import ensureQueryAndMutationTypes from '../utils/ensure-query-and-mutation-types.js'
9
+ import {EXPERIMENTAL_EXTENSIONS} from '../utils/constants.js'
10
+ import validators from '../validators/index.js'
11
11
 
12
12
  export default (
13
13
  source: string,
package/src/index.ts CHANGED
@@ -1,9 +1,9 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
- export {default as configure} from './actions/configure'
4
- export {default as lint} from './actions/lint'
5
- export {default as merge} from './actions/merge'
6
- export {default as print} from './actions/print'
7
- export {default as stitch} from './actions/stitch'
8
- export {default as transpile} from './actions/transpile'
9
- export {default as validate} from './actions/validate'
3
+ export {default as configure} from './actions/configure.js'
4
+ export {default as lint} from './actions/lint.js'
5
+ export {default as merge} from './actions/merge.js'
6
+ export {default as print} from './actions/print.js'
7
+ export {default as stitch} from './actions/stitch.js'
8
+ export {default as transpile} from './actions/transpile.js'
9
+ export {default as validate} from './actions/validate.js'
@@ -1,6 +1,6 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
- import * as debug from 'debug'
3
+ import debug from 'debug'
4
4
 
5
5
  function replaceVars<T>(
6
6
  value: T,
@@ -1,5 +1,5 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
- import envvars from './envvars'
3
+ import envvars from './envvars.js'
4
4
 
5
5
  export default [envvars]
@@ -1,7 +1,7 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
- import * as dotenv from 'dotenv'
4
- import * as debug from 'debug'
3
+ import dotenv from 'dotenv'
4
+ import debug from 'debug'
5
5
 
6
6
  debug('stepzen:dotenv')(
7
7
  `loading .env from ${process.cwd()}, at transpiler/src/utils/constants.ts`,
@@ -1,10 +1,10 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
- import * as fsx from 'fs-extra'
4
- import * as glob from 'glob'
5
- import * as path from 'path'
6
- import {flatMap} from 'lodash'
7
- import {ALL_GRAPHQL_FILES} from './constants'
3
+ import fsx from 'fs-extra'
4
+ import glob from 'glob'
5
+ import path from 'node:path'
6
+ import {flatMap} from 'lodash-es'
7
+ import {ALL_GRAPHQL_FILES} from './constants.js'
8
8
 
9
9
  const WORKSPACE_FILE_PATTERNS = [
10
10
  '**/*.graphql',
@@ -1,8 +1,8 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
3
  import {DocumentNode, parse, print, visit} from 'graphql'
4
4
 
5
- import {cloneDeep} from '../utils/graphql-helpers'
5
+ import {cloneDeep} from '../utils/graphql-helpers.js'
6
6
 
7
7
  export default (schema: string): string => {
8
8
  let ast: DocumentNode = parse(schema)
@@ -1,8 +1,8 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
3
  import {DocumentNode, visit} from 'graphql'
4
4
 
5
- import {cloneDeep} from '../utils/graphql-helpers'
5
+ import {cloneDeep} from '../utils/graphql-helpers.js'
6
6
 
7
7
  export default (ast: DocumentNode): DocumentNode => {
8
8
  let queries: any = []
@@ -1,5 +1,7 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
- export type DeepWriteable<T> = {-readonly [P in keyof T]: DeepWriteable<T[P]>}
3
+ export type DeepWriteable<T> = T extends Function
4
+ ? T
5
+ : {-readonly [P in keyof T]: DeepWriteable<T[P]>}
4
6
  export const cloneDeep = <T>(obj: T): DeepWriteable<T> =>
5
7
  JSON.parse(JSON.stringify(obj))
@@ -1,21 +1,21 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
- import * as debug from 'debug'
3
+ import debug from 'debug'
4
4
  import {ASTNode, BREAK, GraphQLSchema, Kind, visit} from 'graphql'
5
- import {buildSchema} from 'graphql/utilities'
5
+ import {buildSchema} from 'graphql/utilities/index.js'
6
6
  import fetch from '@stepzen/fetch'
7
- import * as fsx from 'fs-extra'
8
- import * as glob from 'glob'
9
- import * as os from 'os'
10
- import * as path from 'path'
11
- import {replace} from 'lodash'
12
-
13
- import {cloneDeep} from '../utils/graphql-helpers'
14
- import {STEPZEN_SERVER_URL} from './constants'
15
-
16
- import configure from '../actions/configure'
17
- import transpile from '../actions/transpile'
18
- import {rmtemp} from './rmtemp'
7
+ import fsx from 'fs-extra'
8
+ import glob from 'glob'
9
+ import os from 'node:os'
10
+ import path from 'node:path'
11
+ import {replace} from 'lodash-es'
12
+
13
+ import {cloneDeep} from '../utils/graphql-helpers.js'
14
+ import {STEPZEN_SERVER_URL} from './constants.js'
15
+
16
+ import configure from '../actions/configure.js'
17
+ import transpile from '../actions/transpile.js'
18
+ import {rmtemp} from './rmtemp.js'
19
19
 
20
20
  export const dedupeTempFolder = (dirpath: string) => {
21
21
  do {
@@ -1,9 +1,9 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
- import * as fs from 'fs'
4
- import * as path from 'path'
5
- import * as os from 'os'
6
- import * as debug from 'debug'
3
+ import fs from 'node:fs'
4
+ import path from 'node:path'
5
+ import os from 'node:os'
6
+ import debug from 'debug'
7
7
 
8
8
  // ----------------------------------------------------------------------------
9
9
  // THIS ENTIRE FILE IS COPIED FROM packages/cli/src/shared/rmtemp.ts
@@ -1,7 +1,6 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
- import * as fs from 'fs'
4
- import * as glob from 'glob'
3
+ import fs from 'node:fs'
5
4
  import {
6
5
  ConstDirectiveNode,
7
6
  DirectiveNode,
@@ -13,12 +12,12 @@ import {
13
12
  OperationTypeNode,
14
13
  visit,
15
14
  } from 'graphql'
16
- import * as path from 'path'
15
+ import path from 'node:path'
17
16
 
18
- import {cloneDeep, DeepWriteable} from './graphql-helpers'
19
- import print from '../actions/print'
20
- import {ALL_GRAPHQL_FILES} from './constants'
21
- import {getAllGraphQLFiles} from './copy-workspace-content'
17
+ import {cloneDeep, DeepWriteable} from './graphql-helpers.js'
18
+ import print from '../actions/print.js'
19
+ import {ALL_GRAPHQL_FILES} from './constants.js'
20
+ import {getAllGraphQLFiles} from './copy-workspace-content.js'
22
21
 
23
22
  const normalizePathSep = (pathlike: string) =>
24
23
  pathlike.replace(path.sep, path.posix.sep)
@@ -26,9 +25,9 @@ const normalizePathSep = (pathlike: string) =>
26
25
  export const createOrUpdateSdlDirective = (
27
26
  importedGraphQLFiles: readonly string[],
28
27
  allGraphQLFiles: readonly string[],
29
- origSdlDirective?: DeepWriteable<DirectiveNode>,
30
- ) => {
31
- let sdlDirective: DeepWriteable<ConstDirectiveNode>
28
+ origSdlDirective?: DirectiveNode | ConstDirectiveNode,
29
+ ): ConstDirectiveNode => {
30
+ let sdlDirective: DeepWriteable<DirectiveNode>
32
31
  if (origSdlDirective) {
33
32
  sdlDirective = cloneDeep(origSdlDirective)
34
33
  } else {
@@ -84,14 +83,14 @@ export const createOrUpdateSdlDirective = (
84
83
  return arg
85
84
  })
86
85
 
87
- return sdlDirective
86
+ return sdlDirective as ConstDirectiveNode
88
87
  }
89
88
 
90
89
  export const createSchemaElement = (
91
90
  importedGraphQLFiles: readonly string[],
92
91
  allGraphQLFiles: readonly string[],
93
- ) => {
94
- const schemaElement: DeepWriteable<SchemaDefinitionNode> = {
92
+ ): SchemaDefinitionNode => {
93
+ const schemaElement = {
95
94
  kind: Kind.SCHEMA_DEFINITION,
96
95
  directives: [
97
96
  createOrUpdateSdlDirective(importedGraphQLFiles, allGraphQLFiles),
@@ -109,7 +108,7 @@ export const createSchemaElement = (
109
108
  },
110
109
  },
111
110
  ],
112
- }
111
+ } satisfies SchemaDefinitionNode
113
112
 
114
113
  return schemaElement
115
114
  }
@@ -130,15 +129,19 @@ export default (source: string, importedGraphQLFiles: readonly string[]) => {
130
129
  directive => directive.name.value === 'sdl',
131
130
  )
132
131
  if (mutated.directives && idx !== undefined && idx > -1) {
133
- mutated.directives[idx] = createOrUpdateSdlDirective(
134
- importedGraphQLFiles,
135
- allGraphQLFiles,
136
- mutated.directives[idx],
137
- )
132
+ ;(mutated.directives[idx] as DirectiveNode) =
133
+ createOrUpdateSdlDirective(
134
+ importedGraphQLFiles,
135
+ allGraphQLFiles,
136
+ mutated.directives[idx],
137
+ )
138
138
  } else {
139
139
  mutated.directives = mutated.directives || []
140
140
  mutated.directives.push(
141
- createOrUpdateSdlDirective(importedGraphQLFiles, allGraphQLFiles),
141
+ createOrUpdateSdlDirective(
142
+ importedGraphQLFiles,
143
+ allGraphQLFiles,
144
+ ) as DeepWriteable<ConstDirectiveNode>,
142
145
  )
143
146
  }
144
147
  return mutated
@@ -150,7 +153,10 @@ export default (source: string, importedGraphQLFiles: readonly string[]) => {
150
153
  Document(node) {
151
154
  const mutated = cloneDeep(node)
152
155
  mutated.definitions.push(
153
- createSchemaElement(importedGraphQLFiles, allGraphQLFiles),
156
+ createSchemaElement(
157
+ importedGraphQLFiles,
158
+ allGraphQLFiles,
159
+ ) as DeepWriteable<SchemaDefinitionNode>,
154
160
  )
155
161
  return mutated
156
162
  },
@@ -1,8 +1,8 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
3
  import {DocumentNode, visit} from 'graphql'
4
4
 
5
- import {cloneDeep} from './graphql-helpers'
5
+ import {cloneDeep} from './graphql-helpers.js'
6
6
 
7
7
  export default (ast: DocumentNode): DocumentNode => {
8
8
  // Loop through the AST and nuke `__query` and `__mutation` stubs
@@ -1,10 +1,10 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
3
  import {DocumentNode, visit} from 'graphql'
4
- import {filter, uniq} from 'lodash'
5
- import * as fs from 'fs'
6
- import * as path from 'path'
7
- import * as yaml from 'yaml'
4
+ import {filter, uniq} from 'lodash-es'
5
+ import fs from 'node:fs'
6
+ import path from 'node:path'
7
+ import yaml from 'yaml'
8
8
 
9
9
  const STEPZEN_DEFAULTS = [
10
10
  'fedex_default',
@@ -1,5 +1,5 @@
1
- // Copyright IBM Corp. 2020, 2024
1
+ // Copyright IBM Corp. 2020, 2025
2
2
 
3
- import configExists from './config-exists'
3
+ import configExists from './config-exists/index.js'
4
4
 
5
5
  export default [configExists]