@graphcommerce/cli 9.0.4-canary.0 → 9.0.4-canary.10
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 +15 -7
- package/dist/bin/codegen.js +3 -3
- package/dist/bin/mesh.js +10 -3
- package/dist/index.js +1 -0
- package/package.json +16 -10
- package/src/bin/codegen.ts +2 -2
- package/src/bin/mesh.ts +8 -1
- package/src/utils/findConfig.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
# @graphcommerce/cli
|
|
2
2
|
|
|
3
|
-
## 9.0.4-canary.
|
|
3
|
+
## 9.0.4-canary.10
|
|
4
|
+
|
|
5
|
+
## 9.0.4-canary.9
|
|
6
|
+
|
|
7
|
+
## 9.0.4-canary.8
|
|
4
8
|
|
|
5
|
-
## 9.0.
|
|
9
|
+
## 9.0.4-canary.7
|
|
6
10
|
|
|
7
|
-
## 9.0.
|
|
11
|
+
## 9.0.4-canary.6
|
|
8
12
|
|
|
9
|
-
## 9.0.
|
|
13
|
+
## 9.0.4-canary.5
|
|
10
14
|
|
|
11
|
-
## 9.0.
|
|
15
|
+
## 9.0.4-canary.4
|
|
12
16
|
|
|
13
|
-
## 9.0.
|
|
17
|
+
## 9.0.4-canary.3
|
|
14
18
|
|
|
15
|
-
## 9.0.
|
|
19
|
+
## 9.0.4-canary.2
|
|
20
|
+
|
|
21
|
+
## 9.0.4-canary.1
|
|
22
|
+
|
|
23
|
+
## 9.0.4-canary.0
|
|
16
24
|
|
|
17
25
|
## 9.0.0
|
|
18
26
|
|
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';
|
|
2
4
|
import { resolveDependenciesSync, packageRoots } from '@graphcommerce/next-config';
|
|
3
5
|
import { cliError, loadCodegenConfig, runCli } from '@graphql-codegen/cli';
|
|
4
6
|
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 undefined;
|
|
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
|
@@ -9,8 +9,8 @@ import dotenv from 'dotenv';
|
|
|
9
9
|
import 'tsx/cjs';
|
|
10
10
|
import 'tsx/esm';
|
|
11
11
|
import yaml from 'yaml';
|
|
12
|
-
import { cosmiconfig, defaultLoaders } from 'cosmiconfig';
|
|
13
12
|
import path from 'path';
|
|
13
|
+
import { cosmiconfig, defaultLoaders } from 'cosmiconfig';
|
|
14
14
|
|
|
15
15
|
function customLoader(ext, importFn = defaultImportFn, initialLoggerPrefix = "\u{1F578}\uFE0F Mesh") {
|
|
16
16
|
const logger = new DefaultLogger(initialLoggerPrefix).child("config");
|
|
@@ -98,7 +98,7 @@ async function cleanup() {
|
|
|
98
98
|
});
|
|
99
99
|
} catch (e) {
|
|
100
100
|
}
|
|
101
|
-
return
|
|
101
|
+
return undefined;
|
|
102
102
|
}
|
|
103
103
|
const main = async () => {
|
|
104
104
|
const baseConf = await findConfig({});
|
|
@@ -169,7 +169,14 @@ const main = async () => {
|
|
|
169
169
|
await promises.writeFile(tmpMeshLocation, yamlString);
|
|
170
170
|
await promises.writeFile(
|
|
171
171
|
`${meshDir}/.mesh.ts`,
|
|
172
|
-
`export * from '${relativePath.split(path$1.sep).join("/")}.mesh'
|
|
172
|
+
`export type * from '${relativePath.split(path$1.sep).join("/")}.mesh'
|
|
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'`,
|
|
173
180
|
{ encoding: "utf8" }
|
|
174
181
|
);
|
|
175
182
|
await graphqlMesh({ ...cliParams, configName: tmpMesh });
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -2,13 +2,19 @@
|
|
|
2
2
|
"name": "@graphcommerce/cli",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "9.0.4-canary.
|
|
5
|
+
"version": "9.0.4-canary.10",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"dev": "pkgroll --watch",
|
|
8
|
-
"build": "pkgroll",
|
|
9
|
-
"prepack": "pkgroll"
|
|
7
|
+
"dev": "pkgroll --clean-dist --watch",
|
|
8
|
+
"build": "pkgroll --clean-dist",
|
|
9
|
+
"prepack": "pkgroll --clean-dist"
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
12
|
+
"types": "./src/index.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
12
18
|
"bin": {
|
|
13
19
|
"gc-gql-codegen": "dist/bin/codegen.js",
|
|
14
20
|
"gc-mesh": "dist/bin/mesh.js",
|
|
@@ -29,12 +35,12 @@
|
|
|
29
35
|
"yaml": "2.6.1"
|
|
30
36
|
},
|
|
31
37
|
"peerDependencies": {
|
|
32
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.4-canary.
|
|
33
|
-
"@graphcommerce/graphql-mesh": "^9.0.4-canary.
|
|
34
|
-
"@graphcommerce/hygraph-cli": "^9.0.4-canary.
|
|
35
|
-
"@graphcommerce/next-config": "^9.0.4-canary.
|
|
36
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.4-canary.
|
|
37
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.4-canary.
|
|
38
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.4-canary.10",
|
|
39
|
+
"@graphcommerce/graphql-mesh": "^9.0.4-canary.10",
|
|
40
|
+
"@graphcommerce/hygraph-cli": "^9.0.4-canary.10",
|
|
41
|
+
"@graphcommerce/next-config": "^9.0.4-canary.10",
|
|
42
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.4-canary.10",
|
|
43
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.4-canary.10",
|
|
38
44
|
"@graphql-mesh/cli": "*",
|
|
39
45
|
"@graphql-mesh/types": "*",
|
|
40
46
|
"@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'
|
|
4
6
|
import { packageRoots, resolveDependenciesSync } from '@graphcommerce/next-config'
|
|
5
7
|
import { cliError, loadCodegenConfig, runCli } from '@graphql-codegen/cli'
|
|
6
8
|
import type { Types } from '@graphql-codegen/plugin-helpers'
|
|
7
9
|
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,7 +165,14 @@ 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 * from '${relativePath.split(path.sep).join('/')}.mesh'
|
|
168
|
+
`export type * from '${relativePath.split(path.sep).join('/')}.mesh'
|
|
169
|
+
export {
|
|
170
|
+
getBuiltMesh as getBuiltMeshBase,
|
|
171
|
+
execute,
|
|
172
|
+
subscribe,
|
|
173
|
+
createBuiltMeshHTTPHandler as createBuiltMeshHTTPHandlerBase,
|
|
174
|
+
rawServeConfig,
|
|
175
|
+
} from '${relativePath.split(path.sep).join('/')}.mesh'`,
|
|
169
176
|
{ encoding: 'utf8' },
|
|
170
177
|
)
|
|
171
178
|
|
package/src/utils/findConfig.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
import path from 'path'
|
|
2
3
|
import type { ConfigProcessOptions } from '@graphql-mesh/config'
|
|
3
|
-
import {
|
|
4
|
+
import { defaultImportFn, DefaultLogger, loadYaml } from '@graphql-mesh/utils'
|
|
4
5
|
import { cosmiconfig, defaultLoaders } from 'cosmiconfig'
|
|
5
|
-
import path from 'path'
|
|
6
6
|
|
|
7
7
|
function customLoader(
|
|
8
8
|
ext: 'json' | 'yaml' | 'js',
|