@graphcommerce/cli 8.0.6 → 8.0.8
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 +9 -2
- package/dist/bin/mesh.js +7 -1
- package/package.json +7 -6
- package/src/bin/mesh.ts +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @graphcommerce/cli
|
|
2
2
|
|
|
3
|
+
## 8.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2382](https://github.com/graphcommerce-org/graphcommerce/pull/2382) [`3cdf3a6`](https://github.com/graphcommerce-org/graphcommerce/commit/3cdf3a60cf2a95aadc0c4ef782edbe5ebb77818d) - Solve TypeError: url?.startsWith is not a function ([@paales](https://github.com/paales))
|
|
8
|
+
|
|
9
|
+
## 8.0.7
|
|
10
|
+
|
|
3
11
|
## 8.0.6
|
|
4
12
|
|
|
5
13
|
## 8.0.5
|
|
@@ -124,8 +132,7 @@
|
|
|
124
132
|
|
|
125
133
|
### Patch Changes
|
|
126
134
|
|
|
127
|
-
- [#2130](https://github.com/graphcommerce-org/graphcommerce/pull/2130) [`83f0c34`](https://github.com/graphcommerce-org/graphcommerce/commit/83f0c346792992143ef533a2043d91a0d090e7b1) - fix: add graphql-codegen-typescript-validation-schema to resolutions …
|
|
128
|
-
([@FrankHarland](https://github.com/FrankHarland))
|
|
135
|
+
- [#2130](https://github.com/graphcommerce-org/graphcommerce/pull/2130) [`83f0c34`](https://github.com/graphcommerce-org/graphcommerce/commit/83f0c346792992143ef533a2043d91a0d090e7b1) - fix: add graphql-codegen-typescript-validation-schema to resolutions … ([@FrankHarland](https://github.com/FrankHarland))
|
|
129
136
|
|
|
130
137
|
## 8.0.0-canary.75
|
|
131
138
|
|
package/dist/bin/mesh.js
CHANGED
|
@@ -13,6 +13,7 @@ const next_config_1 = require("@graphcommerce/next-config");
|
|
|
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"));
|
|
16
|
+
const replace_in_file_1 = require("replace-in-file");
|
|
16
17
|
const yaml_1 = __importDefault(require("yaml"));
|
|
17
18
|
const findConfig_1 = require("../utils/findConfig");
|
|
18
19
|
dotenv_1.default.config();
|
|
@@ -49,7 +50,7 @@ async function cleanup() {
|
|
|
49
50
|
const main = async () => {
|
|
50
51
|
const conf = (await (0, findConfig_1.findConfig)({}));
|
|
51
52
|
// We're configuring a custom fetch function
|
|
52
|
-
conf.customFetch =
|
|
53
|
+
conf.customFetch = '@graphcommerce/graphql-mesh/customFetch';
|
|
53
54
|
conf.serve = { ...conf.serve, endpoint: '/api/graphql' };
|
|
54
55
|
// Rewrite additionalResolvers so we can use module resolution more easily
|
|
55
56
|
conf.additionalResolvers = conf.additionalResolvers ?? [];
|
|
@@ -92,6 +93,11 @@ const main = async () => {
|
|
|
92
93
|
// Reexport the mesh to is can be used by packages
|
|
93
94
|
await node_fs_1.promises.writeFile(`${meshDir}/.mesh.ts`, `export * from '${relativePath.split(node_path_1.default.sep).join('/')}.mesh'`, { encoding: 'utf8' });
|
|
94
95
|
await (0, cli_1.graphqlMesh)({ ...cliParams, configName: tmpMesh });
|
|
96
|
+
const result = await (0, replace_in_file_1.replaceInFile)({
|
|
97
|
+
files: node_path_1.default.join(root, '.mesh', 'index.ts'),
|
|
98
|
+
from: "require('node:url').pathToFileURL(__filename)",
|
|
99
|
+
to: 'import.meta.url',
|
|
100
|
+
});
|
|
95
101
|
await cleanup();
|
|
96
102
|
};
|
|
97
103
|
process.on('SIGINT', cleanup);
|
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.0.
|
|
5
|
+
"version": "8.0.8",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "tsc --preserveWatchOutput --watch",
|
|
8
8
|
"build": "tsc",
|
|
@@ -34,15 +34,16 @@
|
|
|
34
34
|
"detect-package-manager": "^3.0.1",
|
|
35
35
|
"graphql-codegen-typescript-validation-schema": "^0.12.1",
|
|
36
36
|
"graphql-tag": "^2.12.6",
|
|
37
|
+
"replace-in-file": "^7",
|
|
37
38
|
"rimraf": "^5.0.5",
|
|
38
39
|
"tslib": "^2.6.2"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
|
41
|
-
"@graphcommerce/eslint-config-pwa": "^8.0.
|
|
42
|
-
"@graphcommerce/hygraph-cli": "^8.0.
|
|
43
|
-
"@graphcommerce/next-config": "^8.0.
|
|
44
|
-
"@graphcommerce/prettier-config-pwa": "^8.0.
|
|
45
|
-
"@graphcommerce/typescript-config-pwa": "^8.0.
|
|
42
|
+
"@graphcommerce/eslint-config-pwa": "^8.0.8",
|
|
43
|
+
"@graphcommerce/hygraph-cli": "^8.0.8",
|
|
44
|
+
"@graphcommerce/next-config": "^8.0.8",
|
|
45
|
+
"@graphcommerce/prettier-config-pwa": "^8.0.8",
|
|
46
|
+
"@graphcommerce/typescript-config-pwa": "^8.0.8",
|
|
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,
|
|
@@ -14,6 +13,7 @@ import { graphqlMesh, DEFAULT_CLI_PARAMS, GraphQLMeshCLIParams } from '@graphql-
|
|
|
14
13
|
import { Logger, YamlConfig } from '@graphql-mesh/types'
|
|
15
14
|
import { DefaultLogger } from '@graphql-mesh/utils'
|
|
16
15
|
import dotenv from 'dotenv'
|
|
16
|
+
import { replaceInFile } from 'replace-in-file'
|
|
17
17
|
import yaml from 'yaml'
|
|
18
18
|
import { findConfig } from '../utils/findConfig'
|
|
19
19
|
|
|
@@ -54,7 +54,7 @@ const main = async () => {
|
|
|
54
54
|
const conf = (await findConfig({})) as YamlConfig.Config
|
|
55
55
|
|
|
56
56
|
// We're configuring a custom fetch function
|
|
57
|
-
conf.customFetch =
|
|
57
|
+
conf.customFetch = '@graphcommerce/graphql-mesh/customFetch'
|
|
58
58
|
conf.serve = { ...conf.serve, endpoint: '/api/graphql' }
|
|
59
59
|
|
|
60
60
|
// Rewrite additionalResolvers so we can use module resolution more easily
|
|
@@ -111,6 +111,12 @@ const main = async () => {
|
|
|
111
111
|
|
|
112
112
|
await graphqlMesh({ ...cliParams, configName: tmpMesh })
|
|
113
113
|
|
|
114
|
+
const result = await replaceInFile({
|
|
115
|
+
files: path.join(root, '.mesh', 'index.ts'),
|
|
116
|
+
from: "require('node:url').pathToFileURL(__filename)",
|
|
117
|
+
to: 'import.meta.url',
|
|
118
|
+
})
|
|
119
|
+
|
|
114
120
|
await cleanup()
|
|
115
121
|
}
|
|
116
122
|
|