@graphcommerce/cli 8.1.0-canary.9 → 9.0.0-canary.55

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,107 @@
1
1
  # @graphcommerce/cli
2
2
 
3
+ ## 9.0.0-canary.55
4
+
5
+ ## 9.0.0-canary.54
6
+
7
+ ## 8.1.0-canary.53
8
+
9
+ ## 8.1.0-canary.52
10
+
11
+ ## 8.1.0-canary.51
12
+
13
+ ## 8.1.0-canary.50
14
+
15
+ ## 8.1.0-canary.49
16
+
17
+ ## 8.1.0-canary.48
18
+
19
+ ## 8.1.0-canary.47
20
+
21
+ ## 8.1.0-canary.46
22
+
23
+ ## 8.1.0-canary.45
24
+
25
+ ## 8.1.0-canary.44
26
+
27
+ ### Patch Changes
28
+
29
+ - [`44ea147`](https://github.com/graphcommerce-org/graphcommerce/commit/44ea1474d1429d05f535df903beb1fb2c0ca7754) - Added missing tsx package
30
+ ([@paales](https://github.com/paales))
31
+
32
+ ## 8.1.0-canary.43
33
+
34
+ ### Patch Changes
35
+
36
+ - [`6184a28`](https://github.com/graphcommerce-org/graphcommerce/commit/6184a28b2ba2dc70189a9b881887696dc0a346c8) - Fixed issue where codegen would throw an error: SyntaxError: Cannot use import statement outside a module.
37
+ ([@paales](https://github.com/paales))
38
+
39
+ ## 8.1.0-canary.42
40
+
41
+ ## 8.1.0-canary.41
42
+
43
+ ## 8.1.0-canary.40
44
+
45
+ ## 8.1.0-canary.39
46
+
47
+ ## 8.1.0-canary.38
48
+
49
+ ## 8.1.0-canary.37
50
+
51
+ ## 8.1.0-canary.36
52
+
53
+ ## 8.1.0-canary.35
54
+
55
+ ## 8.1.0-canary.34
56
+
57
+ ## 8.1.0-canary.33
58
+
59
+ ## 8.1.0-canary.32
60
+
61
+ ## 8.1.0-canary.31
62
+
63
+ ## 8.1.0-canary.30
64
+
65
+ ## 8.1.0-canary.29
66
+
67
+ ## 8.1.0-canary.28
68
+
69
+ ## 8.1.0-canary.27
70
+
71
+ ## 8.1.0-canary.26
72
+
73
+ ## 8.1.0-canary.25
74
+
75
+ ## 8.1.0-canary.24
76
+
77
+ ## 8.1.0-canary.23
78
+
79
+ ## 8.1.0-canary.22
80
+
81
+ ## 8.1.0-canary.21
82
+
83
+ ## 8.1.0-canary.20
84
+
85
+ ## 8.1.0-canary.19
86
+
87
+ ## 8.1.0-canary.18
88
+
89
+ ## 8.1.0-canary.17
90
+
91
+ ## 8.1.0-canary.16
92
+
93
+ ## 8.1.0-canary.15
94
+
95
+ ## 8.1.0-canary.14
96
+
97
+ ## 8.1.0-canary.13
98
+
99
+ ## 8.1.0-canary.12
100
+
101
+ ## 8.1.0-canary.11
102
+
103
+ ## 8.1.0-canary.10
104
+
3
105
  ## 8.1.0-canary.9
4
106
 
5
107
  ## 8.1.0-canary.8
package/dist/bin/mesh.js CHANGED
@@ -15,6 +15,8 @@ const utils_1 = require("@graphql-mesh/utils");
15
15
  const dotenv_1 = __importDefault(require("dotenv"));
16
16
  const yaml_1 = __importDefault(require("yaml"));
17
17
  const findConfig_1 = require("../utils/findConfig");
18
+ require("tsx/cjs"); // support importing typescript configs in CommonJS
19
+ require("tsx/esm"); // support importing typescript configs in ESM
18
20
  dotenv_1.default.config();
19
21
  function handleFatalError(e, logger = new utils_1.DefaultLogger('◈')) {
20
22
  logger.error(e.stack || e.message);
@@ -48,6 +50,7 @@ async function cleanup() {
48
50
  }
49
51
  const main = async () => {
50
52
  const conf = (await (0, findConfig_1.findConfig)({}));
53
+ const graphCommerce = (0, next_config_1.loadConfig)(root);
51
54
  // We're configuring a custom fetch function
52
55
  conf.customFetch = require.resolve('@graphcommerce/graphql-mesh/customFetch');
53
56
  conf.serve = { ...conf.serve, endpoint: '/api/graphql' };
@@ -72,8 +75,13 @@ const main = async () => {
72
75
  conf.additionalTypeDefs.push('**/*.graphqls');
73
76
  const deps = (0, next_config_1.resolveDependenciesSync)();
74
77
  const packages = [...deps.values()].filter((p) => p !== '.');
78
+ const mV = graphCommerce.magentoVersion ?? 246;
75
79
  (0, next_config_1.packageRoots)(packages).forEach((r) => {
76
- conf.additionalTypeDefs.push(`${r}/**/*.graphqls`);
80
+ const alsoScan = [245, 246, 247, 248, 249, 250, 251, 252, 253, 254]
81
+ .filter((v) => v > mV)
82
+ .map((v) => `${r}/*/schema-${v}/**/*.graphqls`);
83
+ conf.additionalTypeDefs.push(`${r}/*/schema/**/*.graphqls`);
84
+ conf.additionalTypeDefs.push(...alsoScan);
77
85
  });
78
86
  if (!conf.serve)
79
87
  conf.serve = {};
@@ -87,7 +95,7 @@ const main = async () => {
87
95
  },
88
96
  },
89
97
  ];
90
- const yamlString = (0, next_config_1.replaceConfigInString)(yaml_1.default.stringify(conf), (0, next_config_1.loadConfig)(root));
98
+ const yamlString = (0, next_config_1.replaceConfigInString)(yaml_1.default.stringify(conf), graphCommerce);
91
99
  await node_fs_1.promises.writeFile(tmpMeshLocation, yamlString);
92
100
  // Reexport the mesh to is can be used by packages
93
101
  await node_fs_1.promises.writeFile(`${meshDir}/.mesh.ts`, `export * from '${relativePath.split(node_path_1.default.sep).join('/')}.mesh'`, { encoding: 'utf8' });
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": "8.1.0-canary.9",
5
+ "version": "9.0.0-canary.55",
6
6
  "scripts": {
7
7
  "dev": "tsc --preserveWatchOutput --watch",
8
8
  "build": "tsc",
@@ -32,17 +32,18 @@
32
32
  "@graphql-tools/utils": "^10.0.12",
33
33
  "cosmiconfig": "^8.3.6",
34
34
  "detect-package-manager": "^3.0.1",
35
- "graphql-codegen-typescript-validation-schema": "^0.12.1",
35
+ "graphql-codegen-typescript-validation-schema": "^0.14.1",
36
36
  "graphql-tag": "^2.12.6",
37
37
  "rimraf": "^5.0.5",
38
- "tslib": "^2.6.2"
38
+ "tslib": "^2.6.2",
39
+ "tsx": "^4.16.2"
39
40
  },
40
41
  "peerDependencies": {
41
- "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.9",
42
- "@graphcommerce/hygraph-cli": "^8.1.0-canary.9",
43
- "@graphcommerce/next-config": "^8.1.0-canary.9",
44
- "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.9",
45
- "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.9",
42
+ "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.55",
43
+ "@graphcommerce/hygraph-cli": "^9.0.0-canary.55",
44
+ "@graphcommerce/next-config": "^9.0.0-canary.55",
45
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.55",
46
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.55",
46
47
  "graphql": "^16.7.1",
47
48
  "react": "^18.2.0"
48
49
  },
package/src/bin/mesh.ts CHANGED
@@ -4,7 +4,6 @@ import { promises as fs } from 'node:fs'
4
4
  import path from 'node:path'
5
5
  import { exit } from 'node:process'
6
6
  import {
7
- isMonorepo,
8
7
  loadConfig,
9
8
  packageRoots,
10
9
  replaceConfigInString,
@@ -17,6 +16,9 @@ import dotenv from 'dotenv'
17
16
  import yaml from 'yaml'
18
17
  import { findConfig } from '../utils/findConfig'
19
18
 
19
+ import 'tsx/cjs' // support importing typescript configs in CommonJS
20
+ import 'tsx/esm' // support importing typescript configs in ESM
21
+
20
22
  dotenv.config()
21
23
 
22
24
  export function handleFatalError(e: Error, logger: Logger = new DefaultLogger('◈')) {
@@ -52,6 +54,7 @@ async function cleanup() {
52
54
 
53
55
  const main = async () => {
54
56
  const conf = (await findConfig({})) as YamlConfig.Config
57
+ const graphCommerce = loadConfig(root)
55
58
 
56
59
  // We're configuring a custom fetch function
57
60
  conf.customFetch = require.resolve('@graphcommerce/graphql-mesh/customFetch')
@@ -83,8 +86,15 @@ const main = async () => {
83
86
 
84
87
  const deps = resolveDependenciesSync()
85
88
  const packages = [...deps.values()].filter((p) => p !== '.')
89
+
90
+ const mV = graphCommerce.magentoVersion ?? 246
86
91
  packageRoots(packages).forEach((r) => {
87
- conf.additionalTypeDefs.push(`${r}/**/*.graphqls`)
92
+ const alsoScan = [245, 246, 247, 248, 249, 250, 251, 252, 253, 254]
93
+ .filter((v) => v > mV)
94
+ .map((v) => `${r}/*/schema-${v}/**/*.graphqls`)
95
+
96
+ conf.additionalTypeDefs.push(`${r}/*/schema/**/*.graphqls`)
97
+ conf.additionalTypeDefs.push(...alsoScan)
88
98
  })
89
99
 
90
100
  if (!conf.serve) conf.serve = {}
@@ -99,7 +109,7 @@ const main = async () => {
99
109
  },
100
110
  ]
101
111
 
102
- const yamlString = replaceConfigInString(yaml.stringify(conf), loadConfig(root))
112
+ const yamlString = replaceConfigInString(yaml.stringify(conf), graphCommerce)
103
113
  await fs.writeFile(tmpMeshLocation, yamlString)
104
114
 
105
115
  // Reexport the mesh to is can be used by packages