@graphcommerce/cli 5.1.0-canary.3 → 5.1.0-canary.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @graphcommerce/cli
2
2
 
3
+ ## 5.1.0-canary.5
4
+
5
+ ## 5.1.0-canary.4
6
+
7
+ ### Patch Changes
8
+
9
+ - [#1755](https://github.com/graphcommerce-org/graphcommerce/pull/1755) [`b34c7b43a`](https://github.com/graphcommerce-org/graphcommerce/commit/b34c7b43a6e1338152e77f6f8427c3fe559021c5) - Disabled @typescript-eslint/no-unbound-method and fixed various eslint errors ([@paales](https://github.com/paales))
10
+
11
+ - [#1755](https://github.com/graphcommerce-org/graphcommerce/pull/1755) [`053ef07d0`](https://github.com/graphcommerce-org/graphcommerce/commit/053ef07d0acf25fba840b50f3ad56746fc97d6a2) - Add [httpDetailsExtensions](https://the-guild.dev/graphql/mesh/docs/plugins/http-details-extensions) plugin to the mesh for a better debugging experience. ([@paales](https://github.com/paales))
12
+
3
13
  ## 5.1.0-canary.3
4
14
 
5
15
  ### Patch Changes
package/bin/mesh.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  /* eslint-disable import/no-extraneous-dependencies */
3
- /* eslint-disable @typescript-eslint/no-unsafe-argument */
4
3
  import { promises as fs } from 'node:fs'
5
4
  import path from 'node:path'
6
5
  import { exit } from 'node:process'
@@ -66,7 +65,7 @@ const main = async () => {
66
65
  conf.additionalTypeDefs = (
67
66
  Array.isArray(conf.additionalTypeDefs) ? conf.additionalTypeDefs : [conf.additionalTypeDefs]
68
67
  ).map((additionalTypeDef) => {
69
- if (additionalTypeDef.startsWith('@'))
68
+ if (typeof additionalTypeDef === 'string' && additionalTypeDef.startsWith('@'))
70
69
  return path.relative(root, require.resolve(additionalTypeDef))
71
70
 
72
71
  return additionalTypeDef
@@ -84,6 +83,15 @@ const main = async () => {
84
83
  if (!conf.serve) conf.serve = {}
85
84
  if (!conf.serve.playgroundTitle) conf.serve.playgroundTitle = 'GraphCommerce® Mesh'
86
85
 
86
+ conf.plugins = [
87
+ ...(conf.plugins ?? []),
88
+ {
89
+ httpDetailsExtensions: {
90
+ if: "env.NODE_ENV === 'development'",
91
+ },
92
+ },
93
+ ]
94
+
87
95
  await fs.writeFile(tmpMeshLocation, yaml.stringify(conf))
88
96
 
89
97
  // Reexport the mesh to is can be used by packages
@@ -102,6 +110,9 @@ process.on('SIGINT', cleanup)
102
110
  process.on('SIGTERM', cleanup)
103
111
 
104
112
  main().catch((e) => {
113
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
105
114
  cleanup()
106
- return handleFatalError(e, new DefaultLogger(DEFAULT_CLI_PARAMS.initialLoggerPrefix))
115
+ if (e instanceof Error) {
116
+ handleFatalError(e, new DefaultLogger(DEFAULT_CLI_PARAMS.initialLoggerPrefix))
117
+ }
107
118
  })
package/dist/bin/mesh.js CHANGED
@@ -6,7 +6,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.handleFatalError = void 0;
8
8
  /* eslint-disable import/no-extraneous-dependencies */
9
- /* eslint-disable @typescript-eslint/no-unsafe-argument */
10
9
  const node_fs_1 = require("node:fs");
11
10
  const node_path_1 = __importDefault(require("node:path"));
12
11
  const node_process_1 = require("node:process");
@@ -64,7 +63,7 @@ const main = async () => {
64
63
  if (!conf.additionalTypeDefs)
65
64
  conf.additionalTypeDefs = [];
66
65
  conf.additionalTypeDefs = (Array.isArray(conf.additionalTypeDefs) ? conf.additionalTypeDefs : [conf.additionalTypeDefs]).map((additionalTypeDef) => {
67
- if (additionalTypeDef.startsWith('@'))
66
+ if (typeof additionalTypeDef === 'string' && additionalTypeDef.startsWith('@'))
68
67
  return node_path_1.default.relative(root, require.resolve(additionalTypeDef));
69
68
  return additionalTypeDef;
70
69
  });
@@ -81,6 +80,14 @@ const main = async () => {
81
80
  conf.serve = {};
82
81
  if (!conf.serve.playgroundTitle)
83
82
  conf.serve.playgroundTitle = 'GraphCommerce® Mesh';
83
+ conf.plugins = [
84
+ ...(conf.plugins ?? []),
85
+ {
86
+ httpDetailsExtensions: {
87
+ if: "env.NODE_ENV === 'development'",
88
+ },
89
+ },
90
+ ];
84
91
  await node_fs_1.promises.writeFile(tmpMeshLocation, yaml_1.default.stringify(conf));
85
92
  // Reexport the mesh to is can be used by packages
86
93
  await node_fs_1.promises.writeFile(`${meshDir}/.mesh.ts`, `export * from '${relativePath.split(node_path_1.default.sep).join('/')}.mesh'`, { encoding: 'utf8' });
@@ -90,6 +97,9 @@ const main = async () => {
90
97
  process.on('SIGINT', cleanup);
91
98
  process.on('SIGTERM', cleanup);
92
99
  main().catch((e) => {
100
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
93
101
  cleanup();
94
- return handleFatalError(e, new utils_1.DefaultLogger(cli_1.DEFAULT_CLI_PARAMS.initialLoggerPrefix));
102
+ if (e instanceof Error) {
103
+ handleFatalError(e, new utils_1.DefaultLogger(cli_1.DEFAULT_CLI_PARAMS.initialLoggerPrefix));
104
+ }
95
105
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/cli",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "5.1.0-canary.3",
5
+ "version": "5.1.0-canary.5",
6
6
  "author": "",
7
7
  "license": "MIT",
8
8
  "scripts": {
@@ -22,7 +22,7 @@
22
22
  "graphcommerce": "dist/bin/graphcommerce.js"
23
23
  },
24
24
  "dependencies": {
25
- "@graphcommerce/next-config": "5.1.0-canary.3",
25
+ "@graphcommerce/next-config": "5.1.0-canary.5",
26
26
  "@graphql-codegen/cli": "2.15.0",
27
27
  "@graphql-mesh/cli": "0.80.4",
28
28
  "@graphql-mesh/types": "0.87.1",
@@ -35,9 +35,9 @@
35
35
  "ts-node": "^10.9.1"
36
36
  },
37
37
  "devDependencies": {
38
- "@graphcommerce/eslint-config-pwa": "5.1.0-canary.3",
39
- "@graphcommerce/prettier-config-pwa": "5.1.0-canary.3",
40
- "@graphcommerce/typescript-config-pwa": "5.1.0-canary.3",
38
+ "@graphcommerce/eslint-config-pwa": "5.1.0-canary.5",
39
+ "@graphcommerce/prettier-config-pwa": "5.1.0-canary.5",
40
+ "@graphcommerce/typescript-config-pwa": "5.1.0-canary.5",
41
41
  "@types/rimraf": "^3.0.2",
42
42
  "typescript": "4.9.3"
43
43
  },