@graphcommerce/cli 1.0.6 → 1.0.9

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,25 @@
1
1
  # @graphcommerce/cli
2
2
 
3
+ ## 1.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1607](https://github.com/graphcommerce-org/graphcommerce/pull/1607) [`b7009c3eb`](https://github.com/graphcommerce-org/graphcommerce/commit/b7009c3ebf4e4062eeaa00eaae8d572725d3eeb1) Thanks [@paales](https://github.com/paales)! - Add proper exit code to codegen
8
+
9
+ ## 1.0.8
10
+
11
+ ### Patch Changes
12
+
13
+ - [#1598](https://github.com/graphcommerce-org/graphcommerce/pull/1598) [`707dbc73d`](https://github.com/graphcommerce-org/graphcommerce/commit/707dbc73d181204d88fdbbd2e09340e25b2b5f7b) Thanks [@paales](https://github.com/paales)! - Upgraded dependencies
14
+
15
+ ## 1.0.7
16
+
17
+ ### Patch Changes
18
+
19
+ - [#1562](https://github.com/graphcommerce-org/graphcommerce/pull/1562) [`01f1588c9`](https://github.com/graphcommerce-org/graphcommerce/commit/01f1588c9200bb39dd61146e260bfa2b32060612) Thanks [@paales](https://github.com/paales)! - The context was missing in apollo client
20
+
21
+ * [#1501](https://github.com/graphcommerce-org/graphcommerce/pull/1501) [`475d23197`](https://github.com/graphcommerce-org/graphcommerce/commit/475d23197a6ce4b08cc325f872834ca592aa28dc) Thanks [@paales](https://github.com/paales)! - Native windows support added: Directory separator differences and package.json interpretation differences
22
+
3
23
  ## 1.0.6
4
24
 
5
25
  ### Patch Changes
package/bin/codegen.ts CHANGED
@@ -7,8 +7,8 @@ const [, , cmd] = process.argv
7
7
  // console.log(process.argv)
8
8
 
9
9
  runCli(cmd)
10
- .then(() => {
11
- process.exit(0)
10
+ .then((result) => {
11
+ process.exit(result)
12
12
  })
13
13
  .catch((error) => {
14
14
  cliError(error)
package/bin/mesh.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  /* eslint-disable import/no-extraneous-dependencies */
3
3
  /* eslint-disable @typescript-eslint/no-unsafe-argument */
4
- import { promises as fs } from 'fs'
5
- import path from 'path'
6
- import { exit } from 'process'
4
+ import { promises as fs } from 'node:fs'
5
+ import path from 'node:path'
6
+ import { exit } from 'node:process'
7
7
  import { graphqlMesh, DEFAULT_CLI_PARAMS, GraphQLMeshCLIParams } from '@graphql-mesh/cli'
8
8
  import { Logger, YamlConfig } from '@graphql-mesh/types'
9
9
  import { DefaultLogger } from '@graphql-mesh/utils'
@@ -24,7 +24,7 @@ const root = process.cwd()
24
24
  const meshDir = path.dirname(require.resolve('@graphcommerce/graphql-mesh'))
25
25
  const relativePath = path.join(path.relative(meshDir, root), '/')
26
26
 
27
- const isMonoRepo = relativePath.startsWith('../../examples')
27
+ const isMonoRepo = relativePath.startsWith(`..${path.sep}..${path.sep}examples`)
28
28
 
29
29
  const cliParams: GraphQLMeshCLIParams = {
30
30
  ...DEFAULT_CLI_PARAMS,
@@ -84,9 +84,11 @@ const main = async () => {
84
84
  await fs.writeFile(tmpMeshLocation, yaml.stringify(conf))
85
85
 
86
86
  // Reexport the mesh to is can be used by packages
87
- await fs.writeFile(`${meshDir}/.mesh.ts`, `export * from '${relativePath}.mesh'`, {
88
- encoding: 'utf8',
89
- })
87
+ await fs.writeFile(
88
+ `${meshDir}/.mesh.ts`,
89
+ `export * from '${relativePath.split(path.sep).join('/')}.mesh'`,
90
+ { encoding: 'utf8' },
91
+ )
90
92
 
91
93
  await graphqlMesh({ ...cliParams, configName: tmpMesh })
92
94
 
@@ -5,8 +5,8 @@ const cli_1 = require("@graphql-codegen/cli");
5
5
  const [, , cmd] = process.argv;
6
6
  // console.log(process.argv)
7
7
  (0, cli_1.runCli)(cmd)
8
- .then(() => {
9
- process.exit(0);
8
+ .then((result) => {
9
+ process.exit(result);
10
10
  })
11
11
  .catch((error) => {
12
12
  (0, cli_1.cliError)(error);
package/dist/bin/mesh.js CHANGED
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.handleFatalError = void 0;
8
8
  /* eslint-disable import/no-extraneous-dependencies */
9
9
  /* eslint-disable @typescript-eslint/no-unsafe-argument */
10
- const fs_1 = require("fs");
11
- const path_1 = __importDefault(require("path"));
12
- const process_1 = require("process");
10
+ const node_fs_1 = require("node:fs");
11
+ const node_path_1 = __importDefault(require("node:path"));
12
+ const node_process_1 = require("node:process");
13
13
  const cli_1 = require("@graphql-mesh/cli");
14
14
  const utils_1 = require("@graphql-mesh/utils");
15
15
  const dotenv_1 = __importDefault(require("dotenv"));
@@ -21,24 +21,24 @@ function handleFatalError(e, logger = new utils_1.DefaultLogger('◈')) {
21
21
  // eslint-disable-next-line no-console
22
22
  console.log(e);
23
23
  if (process.env.JEST == null)
24
- (0, process_1.exit)(1);
24
+ (0, node_process_1.exit)(1);
25
25
  }
26
26
  exports.handleFatalError = handleFatalError;
27
27
  const root = process.cwd();
28
- const meshDir = path_1.default.dirname(require.resolve('@graphcommerce/graphql-mesh'));
29
- const relativePath = path_1.default.join(path_1.default.relative(meshDir, root), '/');
30
- const isMonoRepo = relativePath.startsWith('../../examples');
28
+ const meshDir = node_path_1.default.dirname(require.resolve('@graphcommerce/graphql-mesh'));
29
+ const relativePath = node_path_1.default.join(node_path_1.default.relative(meshDir, root), '/');
30
+ const isMonoRepo = relativePath.startsWith(`..${node_path_1.default.sep}..${node_path_1.default.sep}examples`);
31
31
  const cliParams = {
32
32
  ...cli_1.DEFAULT_CLI_PARAMS,
33
33
  playgroundTitle: 'GraphCommerce® Mesh',
34
34
  };
35
35
  const tmpMesh = `_tmp_mesh_${Math.random().toString(36).substring(2, 15)}`;
36
- const tmpMeshLocation = path_1.default.join(root, `.${tmpMesh}rc.yml`);
36
+ const tmpMeshLocation = node_path_1.default.join(root, `.${tmpMesh}rc.yml`);
37
37
  async function cleanup() {
38
38
  try {
39
- await fs_1.promises.stat(tmpMeshLocation).then((r) => {
39
+ await node_fs_1.promises.stat(tmpMeshLocation).then((r) => {
40
40
  if (r.isFile())
41
- return fs_1.promises.unlink(tmpMeshLocation);
41
+ return node_fs_1.promises.unlink(tmpMeshLocation);
42
42
  });
43
43
  }
44
44
  catch (e) {
@@ -54,7 +54,7 @@ const main = async () => {
54
54
  if (typeof additionalResolver !== 'string')
55
55
  return additionalResolver;
56
56
  if (additionalResolver.startsWith('@'))
57
- return path_1.default.relative(root, require.resolve(additionalResolver));
57
+ return node_path_1.default.relative(root, require.resolve(additionalResolver));
58
58
  return additionalResolver;
59
59
  });
60
60
  // Rewrite additionalTypeDefs so we can use module resolution more easily
@@ -62,7 +62,7 @@ const main = async () => {
62
62
  conf.additionalTypeDefs = [];
63
63
  conf.additionalTypeDefs = (Array.isArray(conf.additionalTypeDefs) ? conf.additionalTypeDefs : [conf.additionalTypeDefs]).map((additionalTypeDef) => {
64
64
  if (additionalTypeDef.startsWith('@'))
65
- return path_1.default.relative(root, require.resolve(additionalTypeDef));
65
+ return node_path_1.default.relative(root, require.resolve(additionalTypeDef));
66
66
  return additionalTypeDef;
67
67
  });
68
68
  // Scan the current working directory to also read all graphqls files.
@@ -78,11 +78,9 @@ const main = async () => {
78
78
  conf.serve = {};
79
79
  if (!conf.serve.playgroundTitle)
80
80
  conf.serve.playgroundTitle = 'GraphCommerce® Mesh';
81
- await fs_1.promises.writeFile(tmpMeshLocation, yaml_1.default.stringify(conf));
81
+ await node_fs_1.promises.writeFile(tmpMeshLocation, yaml_1.default.stringify(conf));
82
82
  // Reexport the mesh to is can be used by packages
83
- await fs_1.promises.writeFile(`${meshDir}/.mesh.ts`, `export * from '${relativePath}.mesh'`, {
84
- encoding: 'utf8',
85
- });
83
+ await node_fs_1.promises.writeFile(`${meshDir}/.mesh.ts`, `export * from '${relativePath.split(node_path_1.default.sep).join('/')}.mesh'`, { encoding: 'utf8' });
86
84
  await (0, cli_1.graphqlMesh)({ ...cliParams, configName: tmpMesh });
87
85
  await cleanup();
88
86
  };
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": "1.0.6",
5
+ "version": "1.0.9",
6
6
  "author": "",
7
7
  "license": "MIT",
8
8
  "scripts": {
@@ -19,13 +19,13 @@
19
19
  "graphql-code-generator": "dist/bin/codegen.js"
20
20
  },
21
21
  "dependencies": {
22
- "@graphql-codegen/cli": "2.8.0",
23
- "@graphql-mesh/cli": "0.74.1",
24
- "@graphql-mesh/types": "0.78.0",
25
- "@graphql-mesh/utils": "0.37.1"
22
+ "@graphql-codegen/cli": "2.11.6",
23
+ "@graphql-mesh/cli": "0.75.11",
24
+ "@graphql-mesh/types": "0.79.0",
25
+ "@graphql-mesh/utils": "0.38.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@graphcommerce/eslint-config-pwa": "^4.1.9",
28
+ "@graphcommerce/eslint-config-pwa": "^4.1.10",
29
29
  "@graphcommerce/prettier-config-pwa": "^4.0.6",
30
30
  "@graphcommerce/typescript-config-pwa": "^4.0.4",
31
31
  "@playwright/test": "^1.21.1",