@graphcommerce/cli 9.0.4-canary.8 → 9.0.4
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 +7 -11
- package/dist/bin/codegen.js +3 -3
- package/dist/bin/mesh.js +5 -12
- package/package.json +7 -7
- package/src/bin/codegen.ts +2 -2
- package/src/bin/mesh.ts +1 -8
- package/src/utils/findConfig.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
# @graphcommerce/cli
|
|
2
2
|
|
|
3
|
-
## 9.0.4
|
|
3
|
+
## 9.0.4
|
|
4
4
|
|
|
5
|
-
## 9.0.
|
|
5
|
+
## 9.0.3
|
|
6
6
|
|
|
7
|
-
## 9.0.
|
|
7
|
+
## 9.0.3-canary.0
|
|
8
8
|
|
|
9
|
-
## 9.0.
|
|
9
|
+
## 9.0.2
|
|
10
10
|
|
|
11
|
-
## 9.0.
|
|
11
|
+
## 9.0.2-canary.0
|
|
12
12
|
|
|
13
|
-
## 9.0.
|
|
13
|
+
## 9.0.1
|
|
14
14
|
|
|
15
|
-
## 9.0.
|
|
16
|
-
|
|
17
|
-
## 9.0.4-canary.1
|
|
18
|
-
|
|
19
|
-
## 9.0.4-canary.0
|
|
15
|
+
## 9.0.1-canary.1
|
|
20
16
|
|
|
21
17
|
## 9.0.0
|
|
22
18
|
|
package/dist/bin/codegen.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs/promises';
|
|
3
|
-
import path from 'node:path';
|
|
4
2
|
import { resolveDependenciesSync, packageRoots } from '@graphcommerce/next-config';
|
|
5
3
|
import { cliError, loadCodegenConfig, runCli } from '@graphql-codegen/cli';
|
|
6
4
|
import dotenv from 'dotenv';
|
|
5
|
+
import fs from 'node:fs/promises';
|
|
6
|
+
import path from 'node:path';
|
|
7
7
|
import { rimraf } from 'rimraf';
|
|
8
8
|
import yaml from 'yaml';
|
|
9
9
|
|
|
@@ -19,7 +19,7 @@ async function cleanup() {
|
|
|
19
19
|
});
|
|
20
20
|
} catch (e) {
|
|
21
21
|
}
|
|
22
|
-
return
|
|
22
|
+
return void 0;
|
|
23
23
|
}
|
|
24
24
|
function appendDocumentLocations(conf, packages) {
|
|
25
25
|
const documents = Array.isArray(conf.documents) ? conf.documents : [conf.documents];
|
package/dist/bin/mesh.js
CHANGED
|
@@ -4,13 +4,13 @@ import path$1 from 'node:path';
|
|
|
4
4
|
import { exit } from 'node:process';
|
|
5
5
|
import { loadConfig, resolveDependenciesSync, sig, packageRoots, replaceConfigInString } from '@graphcommerce/next-config';
|
|
6
6
|
import { DEFAULT_CLI_PARAMS, graphqlMesh } from '@graphql-mesh/cli';
|
|
7
|
-
import {
|
|
7
|
+
import { defaultImportFn, DefaultLogger, loadYaml, fileURLToPath } from '@graphql-mesh/utils';
|
|
8
8
|
import dotenv from 'dotenv';
|
|
9
9
|
import 'tsx/cjs';
|
|
10
10
|
import 'tsx/esm';
|
|
11
11
|
import yaml from 'yaml';
|
|
12
|
-
import path from 'path';
|
|
13
12
|
import { cosmiconfig, defaultLoaders } from 'cosmiconfig';
|
|
13
|
+
import path from 'path';
|
|
14
14
|
|
|
15
15
|
function customLoader(ext, importFn = defaultImportFn, initialLoggerPrefix = "\u{1F578}\uFE0F Mesh") {
|
|
16
16
|
const logger = new DefaultLogger(initialLoggerPrefix).child("config");
|
|
@@ -40,7 +40,7 @@ function customLoader(ext, importFn = defaultImportFn, initialLoggerPrefix = "\u
|
|
|
40
40
|
return loader;
|
|
41
41
|
}
|
|
42
42
|
async function findConfig(options) {
|
|
43
|
-
const { configName = "mesh", dir: configDir = "", initialLoggerPrefix } = options;
|
|
43
|
+
const { configName = "mesh", dir: configDir = "", initialLoggerPrefix } = options || {};
|
|
44
44
|
const dir = path.isAbsolute(configDir) ? configDir : path.join(process.cwd(), configDir);
|
|
45
45
|
const explorer = cosmiconfig(configName, {
|
|
46
46
|
searchPlaces: [
|
|
@@ -98,7 +98,7 @@ async function cleanup() {
|
|
|
98
98
|
});
|
|
99
99
|
} catch (e) {
|
|
100
100
|
}
|
|
101
|
-
return
|
|
101
|
+
return void 0;
|
|
102
102
|
}
|
|
103
103
|
const main = async () => {
|
|
104
104
|
const baseConf = await findConfig({});
|
|
@@ -169,14 +169,7 @@ const main = async () => {
|
|
|
169
169
|
await promises.writeFile(tmpMeshLocation, yamlString);
|
|
170
170
|
await promises.writeFile(
|
|
171
171
|
`${meshDir}/.mesh.ts`,
|
|
172
|
-
`export
|
|
173
|
-
export {
|
|
174
|
-
getBuiltMesh as getBuiltMeshBase,
|
|
175
|
-
execute,
|
|
176
|
-
subscribe,
|
|
177
|
-
createBuiltMeshHTTPHandler as createBuiltMeshHTTPHandlerBase,
|
|
178
|
-
rawServeConfig,
|
|
179
|
-
} from '${relativePath.split(path$1.sep).join("/")}.mesh'`,
|
|
172
|
+
`export * from '${relativePath.split(path$1.sep).join("/")}.mesh'`,
|
|
180
173
|
{ encoding: "utf8" }
|
|
181
174
|
);
|
|
182
175
|
await graphqlMesh({ ...cliParams, configName: tmpMesh });
|
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": "9.0.4
|
|
5
|
+
"version": "9.0.4",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "pkgroll --watch",
|
|
8
8
|
"build": "pkgroll",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"yaml": "2.6.1"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.4
|
|
33
|
-
"@graphcommerce/graphql-mesh": "^9.0.4
|
|
34
|
-
"@graphcommerce/hygraph-cli": "^9.0.4
|
|
35
|
-
"@graphcommerce/next-config": "^9.0.4
|
|
36
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.4
|
|
37
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.4
|
|
32
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.4",
|
|
33
|
+
"@graphcommerce/graphql-mesh": "^9.0.4",
|
|
34
|
+
"@graphcommerce/hygraph-cli": "^9.0.4",
|
|
35
|
+
"@graphcommerce/next-config": "^9.0.4",
|
|
36
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.4",
|
|
37
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.4",
|
|
38
38
|
"@graphql-mesh/cli": "*",
|
|
39
39
|
"@graphql-mesh/types": "*",
|
|
40
40
|
"@graphql-mesh/utils": "*",
|
package/src/bin/codegen.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
4
|
-
import fs from 'node:fs/promises'
|
|
5
|
-
import path from 'node:path'
|
|
6
4
|
import { packageRoots, resolveDependenciesSync } from '@graphcommerce/next-config'
|
|
7
5
|
import { cliError, loadCodegenConfig, runCli } from '@graphql-codegen/cli'
|
|
8
6
|
import type { Types } from '@graphql-codegen/plugin-helpers'
|
|
9
7
|
import dotenv from 'dotenv'
|
|
8
|
+
import fs from 'node:fs/promises'
|
|
9
|
+
import path from 'node:path'
|
|
10
10
|
import { rimraf } from 'rimraf'
|
|
11
11
|
import yaml from 'yaml'
|
|
12
12
|
|
package/src/bin/mesh.ts
CHANGED
|
@@ -165,14 +165,7 @@ const main = async () => {
|
|
|
165
165
|
// Reexport the mesh to is can be used by packages
|
|
166
166
|
await fs.writeFile(
|
|
167
167
|
`${meshDir}/.mesh.ts`,
|
|
168
|
-
`export
|
|
169
|
-
export {
|
|
170
|
-
getBuiltMesh as getBuiltMeshBase,
|
|
171
|
-
execute,
|
|
172
|
-
subscribe,
|
|
173
|
-
createBuiltMeshHTTPHandler as createBuiltMeshHTTPHandlerBase,
|
|
174
|
-
rawServeConfig,
|
|
175
|
-
} from '${relativePath.split(path.sep).join('/')}.mesh'`,
|
|
168
|
+
`export * from '${relativePath.split(path.sep).join('/')}.mesh'`,
|
|
176
169
|
{ encoding: 'utf8' },
|
|
177
170
|
)
|
|
178
171
|
|
package/src/utils/findConfig.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
import path from 'path'
|
|
3
2
|
import type { ConfigProcessOptions } from '@graphql-mesh/config'
|
|
4
|
-
import {
|
|
3
|
+
import { DefaultLogger, defaultImportFn, loadYaml } from '@graphql-mesh/utils'
|
|
5
4
|
import { cosmiconfig, defaultLoaders } from 'cosmiconfig'
|
|
5
|
+
import path from 'path'
|
|
6
6
|
|
|
7
7
|
function customLoader(
|
|
8
8
|
ext: 'json' | 'yaml' | 'js',
|