@stepzen/transpiler 0.44.0 → 0.45.0-experimental.32a4304

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 (67) hide show
  1. package/lib/actions/configure.js +7 -9
  2. package/lib/actions/configure.js.map +1 -1
  3. package/lib/actions/lint.js +12 -14
  4. package/lib/actions/lint.js.map +1 -1
  5. package/lib/actions/merge.js +43 -45
  6. package/lib/actions/merge.js.map +1 -1
  7. package/lib/actions/print.js +4 -6
  8. package/lib/actions/print.js.map +1 -1
  9. package/lib/actions/stitch.js +23 -25
  10. package/lib/actions/stitch.js.map +1 -1
  11. package/lib/actions/transpile.js +18 -20
  12. package/lib/actions/transpile.js.map +1 -1
  13. package/lib/actions/validate.js +13 -15
  14. package/lib/actions/validate.js.map +1 -1
  15. package/lib/index.d.ts +7 -7
  16. package/lib/index.d.ts.map +1 -1
  17. package/lib/index.js +7 -17
  18. package/lib/index.js.map +1 -1
  19. package/lib/mutations/config/envvars.js +2 -4
  20. package/lib/mutations/config/envvars.js.map +1 -1
  21. package/lib/mutations/config/index.js +2 -4
  22. package/lib/mutations/config/index.js.map +1 -1
  23. package/lib/utils/constants.js +5 -8
  24. package/lib/utils/constants.js.map +1 -1
  25. package/lib/utils/copy-workspace-content.js +9 -13
  26. package/lib/utils/copy-workspace-content.js.map +1 -1
  27. package/lib/utils/dedupe-query-and-mutation-types.js +8 -10
  28. package/lib/utils/dedupe-query-and-mutation-types.js.map +1 -1
  29. package/lib/utils/ensure-query-and-mutation-types.js +6 -8
  30. package/lib/utils/ensure-query-and-mutation-types.js.map +1 -1
  31. package/lib/utils/graphql-helpers.js +1 -5
  32. package/lib/utils/graphql-helpers.js.map +1 -1
  33. package/lib/utils/merge-helpers.js +47 -61
  34. package/lib/utils/merge-helpers.js.map +1 -1
  35. package/lib/utils/rmtemp.js +6 -10
  36. package/lib/utils/rmtemp.js.map +1 -1
  37. package/lib/utils/set-files-in-sdl.d.ts +1 -1
  38. package/lib/utils/set-files-in-sdl.d.ts.map +1 -1
  39. package/lib/utils/set-files-in-sdl.js +37 -42
  40. package/lib/utils/set-files-in-sdl.js.map +1 -1
  41. package/lib/utils/strip-empty-queries-and-mutations.js +7 -9
  42. package/lib/utils/strip-empty-queries-and-mutations.js.map +1 -1
  43. package/lib/validators/config-exists/index.js +9 -11
  44. package/lib/validators/config-exists/index.js.map +1 -1
  45. package/lib/validators/index.js +2 -4
  46. package/lib/validators/index.js.map +1 -1
  47. package/package.json +6 -5
  48. package/src/actions/configure.ts +6 -6
  49. package/src/actions/lint.ts +8 -8
  50. package/src/actions/merge.ts +12 -12
  51. package/src/actions/print.ts +1 -1
  52. package/src/actions/stitch.ts +11 -11
  53. package/src/actions/transpile.ts +11 -11
  54. package/src/actions/validate.ts +6 -6
  55. package/src/index.ts +7 -7
  56. package/src/mutations/config/envvars.ts +1 -1
  57. package/src/mutations/config/index.ts +1 -1
  58. package/src/utils/constants.ts +2 -2
  59. package/src/utils/copy-workspace-content.ts +5 -5
  60. package/src/utils/dedupe-query-and-mutation-types.ts +1 -1
  61. package/src/utils/ensure-query-and-mutation-types.ts +1 -1
  62. package/src/utils/merge-helpers.ts +14 -14
  63. package/src/utils/rmtemp.ts +4 -4
  64. package/src/utils/set-files-in-sdl.ts +7 -7
  65. package/src/utils/strip-empty-queries-and-mutations.ts +1 -1
  66. package/src/validators/config-exists/index.ts +4 -4
  67. package/src/validators/index.ts +1 -1
@@ -1,11 +1,8 @@
1
- "use strict";
2
1
  // Copyright IBM Corp. 2020, 2024
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.rmtemp = void 0;
5
- const fs = require("fs");
6
- const path = require("path");
7
- const os = require("os");
8
- const debug = require("debug");
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import os from 'node:os';
5
+ import debug from 'debug';
9
6
  // ----------------------------------------------------------------------------
10
7
  // THIS ENTIRE FILE IS COPIED FROM packages/cli/src/shared/rmtemp.ts
11
8
  // (because there is no effective way to share util classes between packages yet)
@@ -18,7 +15,7 @@ const debug = require("debug");
18
15
  *
19
16
  * @param {*} fileOrDirPath path to a temp file or folder to delete
20
17
  */
21
- const rmtemp = (fileOrDirPath) => {
18
+ export const rmtemp = (fileOrDirPath) => {
22
19
  if (!fileOrDirPath) {
23
20
  return;
24
21
  }
@@ -38,6 +35,5 @@ const rmtemp = (fileOrDirPath) => {
38
35
  debug('stepzen:rmtemp')(`WARN: got a temp path ${fileOrDirPath} out of the TMP folder -- ignoring`);
39
36
  }
40
37
  };
41
- exports.rmtemp = rmtemp;
42
- exports.default = exports.rmtemp;
38
+ export default rmtemp;
43
39
  //# sourceMappingURL=rmtemp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rmtemp.js","sourceRoot":"","sources":["../../src/utils/rmtemp.ts"],"names":[],"mappings":";AAAA,iCAAiC;;;AAEjC,yBAAwB;AACxB,6BAA4B;AAC5B,yBAAwB;AACxB,+BAA8B;AAE9B,+EAA+E;AAC/E,yEAAyE;AACzE,iFAAiF;AACjF,+EAA+E;AAE/E;;;;;;;GAOG;AACI,MAAM,MAAM,GAAG,CAAC,aAAsB,EAAE,EAAE;IAC/C,IAAI,CAAC,aAAa,EAAE;QAClB,OAAM;KACP;IAED,uCAAuC;IACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,aAAa,CAAC,CAAA;IAC1D,MAAM,QAAQ,GACZ,QAAQ,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;IAEtE,IAAI,QAAQ,EAAE;QACZ,IAAI;YACF,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,EAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;SACzD;QAAC,OAAO,KAAK,EAAE;YACd,gBAAgB;YAChB,KAAK,CAAC,gBAA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B,aAAa,oCAAoC,CAC3E,CAAA;KACF;AACH,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { ConstDirectiveNode, DirectiveNode, SchemaDefinitionNode } from 'graphql';
2
- import { DeepWriteable } from './graphql-helpers';
2
+ import { DeepWriteable } from './graphql-helpers.js';
3
3
  export declare const createOrUpdateSdlDirective: (importedGraphQLFiles: readonly string[], allGraphQLFiles: readonly string[], origSdlDirective?: DeepWriteable<DirectiveNode>) => DeepWriteable<ConstDirectiveNode>;
4
4
  export declare const createSchemaElement: (importedGraphQLFiles: readonly string[], allGraphQLFiles: readonly string[]) => DeepWriteable<SchemaDefinitionNode>;
5
5
  declare const _default: (source: string, importedGraphQLFiles: readonly string[]) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"set-files-in-sdl.d.ts","sourceRoot":"","sources":["../../src/utils/set-files-in-sdl.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,kBAAkB,EAClB,aAAa,EAIb,oBAAoB,EAIrB,MAAM,SAAS,CAAA;AAGhB,OAAO,EAAY,aAAa,EAAC,MAAM,mBAAmB,CAAA;AAQ1D,eAAO,MAAM,0BAA0B,yBACf,SAAS,MAAM,EAAE,mBACtB,SAAS,MAAM,EAAE,qBACf,cAAc,aAAa,CAAC,sCA2DhD,CAAA;AAED,eAAO,MAAM,mBAAmB,yBACR,SAAS,MAAM,EAAE,mBACtB,SAAS,MAAM,EAAE,wCAuBnC,CAAA;iCAEuB,MAAM,wBAAwB,SAAS,MAAM,EAAE;AAAvE,wBA4CC"}
1
+ {"version":3,"file":"set-files-in-sdl.d.ts","sourceRoot":"","sources":["../../src/utils/set-files-in-sdl.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,kBAAkB,EAClB,aAAa,EAIb,oBAAoB,EAIrB,MAAM,SAAS,CAAA;AAGhB,OAAO,EAAY,aAAa,EAAC,MAAM,sBAAsB,CAAA;AAQ7D,eAAO,MAAM,0BAA0B,yBACf,SAAS,MAAM,EAAE,mBACtB,SAAS,MAAM,EAAE,qBACf,cAAc,aAAa,CAAC,sCA2DhD,CAAA;AAED,eAAO,MAAM,mBAAmB,yBACR,SAAS,MAAM,EAAE,mBACtB,SAAS,MAAM,EAAE,wCAuBnC,CAAA;iCAEuB,MAAM,wBAAwB,SAAS,MAAM,EAAE;AAAvE,wBA4CC"}
@@ -1,40 +1,37 @@
1
- "use strict";
2
1
  // Copyright IBM Corp. 2020, 2024
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.createSchemaElement = exports.createOrUpdateSdlDirective = void 0;
5
- const fs = require("fs");
6
- const graphql_1 = require("graphql");
7
- const path = require("path");
8
- const graphql_helpers_1 = require("./graphql-helpers");
9
- const print_1 = require("../actions/print");
10
- const constants_1 = require("./constants");
11
- const copy_workspace_content_1 = require("./copy-workspace-content");
2
+ import fs from 'node:fs';
3
+ import { Kind, parse, OperationTypeNode, visit, } from 'graphql';
4
+ import path from 'node:path';
5
+ import { cloneDeep } from './graphql-helpers.js';
6
+ import print from '../actions/print.js';
7
+ import { ALL_GRAPHQL_FILES } from './constants.js';
8
+ import { getAllGraphQLFiles } from './copy-workspace-content.js';
12
9
  const normalizePathSep = (pathlike) => pathlike.replace(path.sep, path.posix.sep);
13
- const createOrUpdateSdlDirective = (importedGraphQLFiles, allGraphQLFiles, origSdlDirective) => {
10
+ export const createOrUpdateSdlDirective = (importedGraphQLFiles, allGraphQLFiles, origSdlDirective) => {
14
11
  let sdlDirective;
15
12
  if (origSdlDirective) {
16
- sdlDirective = (0, graphql_helpers_1.cloneDeep)(origSdlDirective);
13
+ sdlDirective = cloneDeep(origSdlDirective);
17
14
  }
18
15
  else {
19
16
  sdlDirective = {
20
- kind: graphql_1.Kind.DIRECTIVE,
17
+ kind: Kind.DIRECTIVE,
21
18
  name: {
22
- kind: graphql_1.Kind.NAME,
19
+ kind: Kind.NAME,
23
20
  value: 'sdl',
24
21
  },
25
22
  arguments: [
26
23
  {
27
- kind: graphql_1.Kind.ARGUMENT,
24
+ kind: Kind.ARGUMENT,
28
25
  name: {
29
- kind: graphql_1.Kind.NAME,
26
+ kind: Kind.NAME,
30
27
  value: 'files',
31
28
  },
32
29
  value: {
33
- kind: graphql_1.Kind.LIST,
30
+ kind: Kind.LIST,
34
31
  values: [
35
32
  {
36
- kind: graphql_1.Kind.STRING,
37
- value: constants_1.ALL_GRAPHQL_FILES,
33
+ kind: Kind.STRING,
34
+ value: ALL_GRAPHQL_FILES,
38
35
  },
39
36
  ],
40
37
  },
@@ -51,12 +48,12 @@ const createOrUpdateSdlDirective = (importedGraphQLFiles, allGraphQLFiles, origS
51
48
  // Make sure paths in the `@sdl()` directive use the `/` separator
52
49
  // even on Windows.
53
50
  ].map(normalizePathSep));
54
- if (fileset.has(constants_1.ALL_GRAPHQL_FILES)) {
55
- fileset.delete(constants_1.ALL_GRAPHQL_FILES);
51
+ if (fileset.has(ALL_GRAPHQL_FILES)) {
52
+ fileset.delete(ALL_GRAPHQL_FILES);
56
53
  allGraphQLFiles.forEach(file => fileset.add(normalizePathSep(file)));
57
54
  }
58
55
  filesValueNodes.values = [...fileset].map(file => ({
59
- kind: graphql_1.Kind.STRING,
56
+ kind: Kind.STRING,
60
57
  value: file,
61
58
  }));
62
59
  }
@@ -64,21 +61,20 @@ const createOrUpdateSdlDirective = (importedGraphQLFiles, allGraphQLFiles, origS
64
61
  });
65
62
  return sdlDirective;
66
63
  };
67
- exports.createOrUpdateSdlDirective = createOrUpdateSdlDirective;
68
- const createSchemaElement = (importedGraphQLFiles, allGraphQLFiles) => {
64
+ export const createSchemaElement = (importedGraphQLFiles, allGraphQLFiles) => {
69
65
  const schemaElement = {
70
- kind: graphql_1.Kind.SCHEMA_DEFINITION,
66
+ kind: Kind.SCHEMA_DEFINITION,
71
67
  directives: [
72
- (0, exports.createOrUpdateSdlDirective)(importedGraphQLFiles, allGraphQLFiles),
68
+ createOrUpdateSdlDirective(importedGraphQLFiles, allGraphQLFiles),
73
69
  ],
74
70
  operationTypes: [
75
71
  {
76
- kind: graphql_1.Kind.OPERATION_TYPE_DEFINITION,
77
- operation: graphql_1.OperationTypeNode.QUERY,
72
+ kind: Kind.OPERATION_TYPE_DEFINITION,
73
+ operation: OperationTypeNode.QUERY,
78
74
  type: {
79
- kind: graphql_1.Kind.NAMED_TYPE,
75
+ kind: Kind.NAMED_TYPE,
80
76
  name: {
81
- kind: graphql_1.Kind.NAME,
77
+ kind: Kind.NAME,
82
78
  value: 'Query',
83
79
  },
84
80
  },
@@ -87,37 +83,36 @@ const createSchemaElement = (importedGraphQLFiles, allGraphQLFiles) => {
87
83
  };
88
84
  return schemaElement;
89
85
  };
90
- exports.createSchemaElement = createSchemaElement;
91
- exports.default = (source, importedGraphQLFiles) => {
92
- const allGraphQLFiles = (0, copy_workspace_content_1.getAllGraphQLFiles)(source);
86
+ export default (source, importedGraphQLFiles) => {
87
+ const allGraphQLFiles = getAllGraphQLFiles(source);
93
88
  const output = path.join(source, 'index.graphql');
94
89
  const index = fs.readFileSync(output, 'utf8');
95
90
  let hasSchemaElement;
96
- let ast = (0, graphql_1.parse)(index);
97
- ast = (0, graphql_1.visit)(ast, {
91
+ let ast = parse(index);
92
+ ast = visit(ast, {
98
93
  SchemaDefinition(node) {
99
94
  hasSchemaElement = true;
100
- const mutated = (0, graphql_helpers_1.cloneDeep)(node);
95
+ const mutated = cloneDeep(node);
101
96
  const idx = mutated.directives?.findIndex(directive => directive.name.value === 'sdl');
102
97
  if (mutated.directives && idx !== undefined && idx > -1) {
103
- mutated.directives[idx] = (0, exports.createOrUpdateSdlDirective)(importedGraphQLFiles, allGraphQLFiles, mutated.directives[idx]);
98
+ mutated.directives[idx] = createOrUpdateSdlDirective(importedGraphQLFiles, allGraphQLFiles, mutated.directives[idx]);
104
99
  }
105
100
  else {
106
101
  mutated.directives = mutated.directives || [];
107
- mutated.directives.push((0, exports.createOrUpdateSdlDirective)(importedGraphQLFiles, allGraphQLFiles));
102
+ mutated.directives.push(createOrUpdateSdlDirective(importedGraphQLFiles, allGraphQLFiles));
108
103
  }
109
104
  return mutated;
110
105
  },
111
106
  });
112
107
  if (!hasSchemaElement) {
113
- ast = (0, graphql_1.visit)(ast, {
108
+ ast = visit(ast, {
114
109
  Document(node) {
115
- const mutated = (0, graphql_helpers_1.cloneDeep)(node);
116
- mutated.definitions.push((0, exports.createSchemaElement)(importedGraphQLFiles, allGraphQLFiles));
110
+ const mutated = cloneDeep(node);
111
+ mutated.definitions.push(createSchemaElement(importedGraphQLFiles, allGraphQLFiles));
117
112
  return mutated;
118
113
  },
119
114
  });
120
115
  }
121
- fs.writeFileSync(output, (0, print_1.default)(ast));
116
+ fs.writeFileSync(output, print(ast));
122
117
  };
123
118
  //# sourceMappingURL=set-files-in-sdl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"set-files-in-sdl.js","sourceRoot":"","sources":["../../src/utils/set-files-in-sdl.ts"],"names":[],"mappings":";AAAA,iCAAiC;;;AAEjC,yBAAwB;AAExB,qCAUgB;AAChB,6BAA4B;AAE5B,uDAA0D;AAC1D,4CAAoC;AACpC,2CAA6C;AAC7C,qEAA2D;AAE3D,MAAM,gBAAgB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAC5C,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AAErC,MAAM,0BAA0B,GAAG,CACxC,oBAAuC,EACvC,eAAkC,EAClC,gBAA+C,EAC/C,EAAE;IACF,IAAI,YAA+C,CAAA;IACnD,IAAI,gBAAgB,EAAE;QACpB,YAAY,GAAG,IAAA,2BAAS,EAAC,gBAAgB,CAAC,CAAA;KAC3C;SAAM;QACL,YAAY,GAAG;YACb,IAAI,EAAE,cAAI,CAAC,SAAS;YACpB,IAAI,EAAE;gBACJ,IAAI,EAAE,cAAI,CAAC,IAAI;gBACf,KAAK,EAAE,KAAK;aACb;YACD,SAAS,EAAE;gBACT;oBACE,IAAI,EAAE,cAAI,CAAC,Q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AAC,CAAA;gBAC/B,OAAO,CAAC,WAAW,CAAC,IAAI,CACtB,mBAAmB,CAAC,oBAAoB,EAAE,eAAe,CAAC,CAC3D,CAAA;gBACD,OAAO,OAAO,CAAA;YAChB,CAAC;SACF,CAAC,CAAA;KACH;IAED,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;AACtC,CAAC,CAAA"}
@@ -1,22 +1,20 @@
1
- "use strict";
2
1
  // Copyright IBM Corp. 2020, 2024
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const graphql_1 = require("graphql");
5
- const graphql_helpers_1 = require("./graphql-helpers");
6
- exports.default = (ast) => {
2
+ import { visit } from 'graphql';
3
+ import { cloneDeep } from './graphql-helpers.js';
4
+ export default (ast) => {
7
5
  // Loop through the AST and nuke `__query` and `__mutation` stubs
8
- ast = (0, graphql_1.visit)(ast, {
6
+ ast = visit(ast, {
9
7
  ObjectTypeDefinition: {
10
8
  enter(node) {
11
9
  if (node.name.kind === 'Name' && node.name.value === 'Query') {
12
- const mutated = (0, graphql_helpers_1.cloneDeep)(node);
10
+ const mutated = cloneDeep(node);
13
11
  mutated.fields = mutated.fields.filter((field) => {
14
12
  return field.name.value !== '__query';
15
13
  });
16
14
  return mutated;
17
15
  }
18
16
  if (node.name.kind === 'Name' && node.name.value === 'Mutation') {
19
- const mutated = (0, graphql_helpers_1.cloneDeep)(node);
17
+ const mutated = cloneDeep(node);
20
18
  mutated.fields = mutated.fields.filter((field) => {
21
19
  return field.name.value !== '__mutated';
22
20
  });
@@ -26,7 +24,7 @@ exports.default = (ast) => {
26
24
  },
27
25
  });
28
26
  // Strip empty Queries and Mutations definitions
29
- ast = (0, graphql_1.visit)(ast, {
27
+ ast = visit(ast, {
30
28
  ObjectTypeDefinition: {
31
29
  enter(node) {
32
30
  if (node.name.kind === 'Name' && node.name.value === 'Query') {
@@ -1 +1 @@
1
- {"version":3,"file":"strip-empty-queries-and-mutations.js","sourceRo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D,MAAM,OAAO,GAAQ,SAAS,CAAC,IAAI,CAAC,CAAA;oBACpC,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE;wBACpD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,WAAW,CAAA;oBACzC,CAAC,CAAC,CAAA;oBACF,OAAO,OAAO,CAAA;iBACf;YACH,CAAC;SACF;KACF,CAAC,CAAA;IAEF,gDAAgD;IAChD,GAAG,GAAG,KAAK,CAAC,GAAG,EAAE;QACf,oBAAoB,EAAE;YACpB,KAAK,CAAC,IAAI;gBACR,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,OAAO,EAAE;oBAC5D,IAAI,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC;wBAAE,OAAO,IAAI,CAAA;iBAC3C;gBACD,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,UAAU,EAAE;oBAC/D,IAAI,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC;wBAAE,OAAO,IAAI,CAAA;iBAC3C;YACH,CAAC;SACF;KACF,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA"}
@@ -1,11 +1,9 @@
1
- "use strict";
2
1
  // Copyright IBM Corp. 2020, 2024
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const graphql_1 = require("graphql");
5
- const lodash_1 = require("lodash");
6
- const fs = require("fs");
7
- const path = require("path");
8
- const yaml = require("yaml");
2
+ import { visit } from 'graphql';
3
+ import { filter, uniq } from 'lodash-es';
4
+ import fs from 'node:fs';
5
+ import path from 'node:path';
6
+ import yaml from 'yaml';
9
7
  const STEPZEN_DEFAULTS = [
10
8
  'fedex_default',
11
9
  'holidayapi_default',
@@ -13,9 +11,9 @@ const STEPZEN_DEFAULTS = [
13
11
  'owm_default',
14
12
  'ups_default',
15
13
  ];
16
- exports.default = (ast, source) => {
14
+ export default (ast, source) => {
17
15
  let configs = [];
18
- (0, graphql_1.visit)(ast, {
16
+ visit(ast, {
19
17
  Argument(node) {
20
18
  const name = node.name?.value;
21
19
  const value = node.value?.value;
@@ -24,8 +22,8 @@ exports.default = (ast, source) => {
24
22
  }
25
23
  },
26
24
  });
27
- configs = (0, lodash_1.uniq)(configs);
28
- configs = (0, lodash_1.filter)(configs, config => !STEPZEN_DEFAULTS.includes(config));
25
+ configs = uniq(configs);
26
+ configs = filter(configs, config => !STEPZEN_DEFAULTS.includes(config));
29
27
  if (configs.length > 0) {
30
28
  const sourceConfig = path.join(source, 'config.yaml');
31
29
  if (!fs.existsSync(sourceConfig)) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validators/config-exists/index.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAEjC,qCAA2C;AAC3C,mCAAmC;AACnC,yBAAwB;AACxB,6BAA4B;AAC5B,6BAA4B;AAE5B,MAAM,gBAAgB,GAAG;IACvB,eAAe;IACf,oBAAoB;IACpB,eAAe;IACf,aAAa;IACb,aAAa;CACd,CAAA;AAED,kBAAe,CAAC,GAAiB,EAAE,MAAc,EAAE,EAAE;IACnD,IAAI,OAAO,GAAQ,EAAE,CAAA;IAErB,IAAA,eAAK,EAAC,GAAG,EAAE;QACT,QAAQ,CAAC,IAAS;YAChB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,CAAA;YAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,KAAK,CAAA;YAE/B,IAAI,IAAI,KAAK,eAAe,EAAE;gBAC5B,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;aAChC;QACH,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,GAAG,IAAA,aAAI,EAAC,OAAO,CAAC,CAAA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EF,IAAI,CAAC,KAAK,EAAE;gBACV,MAAM,IAAI,KAAK,CAAC,0CAA0C,MAAM,GAAG,CAAC,CAAA;aACrE;SACF;KACF;IAED,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
@@ -1,6 +1,4 @@
1
- "use strict";
2
1
  // Copyright IBM Corp. 2020, 2024
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const config_exists_1 = require("./config-exists");
5
- exports.default = [config_exists_1.default];
2
+ import configExists from './config-exists/index.js';
3
+ export default [configExists];
6
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAEjC,mDAA0C;AAE1C,kBAAe,CAAC,uBAAY,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAAA,iCAAiC;AAEjC,OAAO,YAAY,MAAM,0BAA0B,CAAA;AAEnD,eAAe,CAAC,YAAY,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@stepzen/transpiler",
3
3
  "description": "The StepZen transpiler",
4
- "version": "0.44.0",
4
+ "version": "0.45.0-experimental.32a4304",
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": {
@@ -23,14 +24,14 @@
23
24
  },
24
25
  "dependencies": {
25
26
  "@graphql-tools/merge": "^8.3.15",
26
- "@stepzen/fetch": "0.44.0",
27
+ "@stepzen/fetch": "0.45.0-experimental.32a4304",
27
28
  "debug": "^4.3.4",
28
29
  "dotenv": "^16.0.3",
29
30
  "fs-extra": "^9.1.0",
30
31
  "glob": "^7.2.3",
31
32
  "graphql": "^16.8.1",
32
33
  "inquirer": "^8.2.5",
33
- "lodash": "^4.17.21",
34
+ "lodash-es": "^4.17.21",
34
35
  "prettier": "^2.8.3",
35
36
  "shelljs": "^0.8.5",
36
37
  "yaml": "^2.2.2"
@@ -42,7 +43,7 @@
42
43
  "@types/glob": "^7.2.0",
43
44
  "@types/inquirer": "^8.2.5",
44
45
  "@types/license-checker": "^25.0.3",
45
- "@types/lodash": "^4.14.168",
46
+ "@types/lodash-es": "^4.17.12",
46
47
  "@types/mocha": "^10.0.1",
47
48
  "@types/mock-fs": "^4.13.0",
48
49
  "@types/node": "^14.18.36",
@@ -58,5 +59,5 @@
58
59
  "nyc": "^15.1.0",
59
60
  "ts-node": "^10.8.2"
60
61
  },
61
- "gitHead": "9afcacbee765998d29795896f8969fd9e4e29926"
62
+ "gitHead": "32a43047da221d51d7680e769ed11f766dcaaba5"
62
63
  }
@@ -1,11 +1,11 @@
1
1
  // Copyright IBM Corp. 2020, 2024
2
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'
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
1
  // Copyright IBM Corp. 2020, 2024
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'
7
-
8
- import stitch from '../actions/stitch'
9
- import {getExtensions} from '../utils/merge-helpers'
10
- import {rmtemp} from '../utils/rmtemp'
3
+ import fsx from 'fs-extra'
4
+ import os from 'node:os'
5
+ import path from 'node:path'
6
+ import shell from 'shelljs'
7
+
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
1
  // Copyright IBM Corp. 2020, 2024
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
1
  // Copyright IBM Corp. 2020, 2024
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
1
  // Copyright IBM Corp. 2020, 2024
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
1
  // Copyright IBM Corp. 2020, 2024
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
1
  // Copyright IBM Corp. 2020, 2024
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
1
  // Copyright IBM Corp. 2020, 2024
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
1
  // Copyright IBM Corp. 2020, 2024
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
1
  // Copyright IBM Corp. 2020, 2024
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
1
  // Copyright IBM Corp. 2020, 2024
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
1
  // Copyright IBM Corp. 2020, 2024
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',