@graphcommerce/cli 1.0.2 → 1.0.5
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 +18 -0
- package/bin/mesh.ts +9 -5
- package/dist/bin/mesh.js +9 -4
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @graphcommerce/cli
|
|
2
2
|
|
|
3
|
+
## 1.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1490](https://github.com/graphcommerce-org/graphcommerce/pull/1490) [`d311ef48b`](https://github.com/graphcommerce-org/graphcommerce/commit/d311ef48bb3e97806d992af5516d6b7f183ec9cb) Thanks [@paales](https://github.com/paales)! - upgraded packages
|
|
8
|
+
|
|
9
|
+
## 1.0.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#1439](https://github.com/graphcommerce-org/graphcommerce/pull/1439) [`25ef6cf08`](https://github.com/graphcommerce-org/graphcommerce/commit/25ef6cf08c278105307d6f604b7135d637e9046c) Thanks [@paales](https://github.com/paales)! - Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 1.0.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#1429](https://github.com/graphcommerce-org/graphcommerce/pull/1429) [`ba8cd4d34`](https://github.com/graphcommerce-org/graphcommerce/commit/ba8cd4d3480a7ec7e555b051cfd0fbc809c7aa12) Thanks [@paales](https://github.com/paales)! - mesh couldn’t be generated properly in a non-monorepo setup
|
|
20
|
+
|
|
3
21
|
## 1.0.2
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/bin/mesh.ts
CHANGED
|
@@ -26,20 +26,19 @@ const relativePath = path.join(path.relative(meshDir, root), '/')
|
|
|
26
26
|
|
|
27
27
|
const isMonoRepo = relativePath.startsWith('../../examples')
|
|
28
28
|
|
|
29
|
-
const artifactsDir = path.join(path.relative(root, meshDir), '/.mesh')
|
|
30
|
-
|
|
31
29
|
const cliParams: GraphQLMeshCLIParams = {
|
|
32
30
|
...DEFAULT_CLI_PARAMS,
|
|
33
|
-
artifactsDir,
|
|
34
31
|
playgroundTitle: 'GraphCommerce® Mesh',
|
|
35
32
|
}
|
|
36
33
|
|
|
37
34
|
const tmpMesh = `_tmp_mesh_${Math.random().toString(36).substring(2, 15)}`
|
|
38
35
|
const tmpMeshLocation = path.join(root, `.${tmpMesh}rc.yml`)
|
|
39
36
|
|
|
40
|
-
function cleanup() {
|
|
37
|
+
async function cleanup() {
|
|
41
38
|
try {
|
|
42
|
-
|
|
39
|
+
await fs.stat(tmpMeshLocation).then((r) => {
|
|
40
|
+
if (r.isFile()) return fs.unlink(tmpMeshLocation)
|
|
41
|
+
})
|
|
43
42
|
} catch (e) {
|
|
44
43
|
// ignore
|
|
45
44
|
}
|
|
@@ -84,6 +83,11 @@ const main = async () => {
|
|
|
84
83
|
|
|
85
84
|
await fs.writeFile(tmpMeshLocation, yaml.stringify(conf))
|
|
86
85
|
|
|
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
|
+
})
|
|
90
|
+
|
|
87
91
|
await graphqlMesh({ ...cliParams, configName: tmpMesh })
|
|
88
92
|
|
|
89
93
|
await cleanup()
|
package/dist/bin/mesh.js
CHANGED
|
@@ -28,17 +28,18 @@ const root = process.cwd();
|
|
|
28
28
|
const meshDir = path_1.default.dirname(require.resolve('@graphcommerce/graphql-mesh'));
|
|
29
29
|
const relativePath = path_1.default.join(path_1.default.relative(meshDir, root), '/');
|
|
30
30
|
const isMonoRepo = relativePath.startsWith('../../examples');
|
|
31
|
-
const artifactsDir = path_1.default.join(path_1.default.relative(root, meshDir), '/.mesh');
|
|
32
31
|
const cliParams = {
|
|
33
32
|
...cli_1.DEFAULT_CLI_PARAMS,
|
|
34
|
-
artifactsDir,
|
|
35
33
|
playgroundTitle: 'GraphCommerce® Mesh',
|
|
36
34
|
};
|
|
37
35
|
const tmpMesh = `_tmp_mesh_${Math.random().toString(36).substring(2, 15)}`;
|
|
38
36
|
const tmpMeshLocation = path_1.default.join(root, `.${tmpMesh}rc.yml`);
|
|
39
|
-
function cleanup() {
|
|
37
|
+
async function cleanup() {
|
|
40
38
|
try {
|
|
41
|
-
|
|
39
|
+
await fs_1.promises.stat(tmpMeshLocation).then((r) => {
|
|
40
|
+
if (r.isFile())
|
|
41
|
+
return fs_1.promises.unlink(tmpMeshLocation);
|
|
42
|
+
});
|
|
42
43
|
}
|
|
43
44
|
catch (e) {
|
|
44
45
|
// ignore
|
|
@@ -78,6 +79,10 @@ const main = async () => {
|
|
|
78
79
|
if (!conf.serve.playgroundTitle)
|
|
79
80
|
conf.serve.playgroundTitle = 'GraphCommerce® Mesh';
|
|
80
81
|
await fs_1.promises.writeFile(tmpMeshLocation, yaml_1.default.stringify(conf));
|
|
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
|
+
});
|
|
81
86
|
await (0, cli_1.graphqlMesh)({ ...cliParams, configName: tmpMesh });
|
|
82
87
|
await cleanup();
|
|
83
88
|
};
|
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.
|
|
5
|
+
"version": "1.0.5",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"scripts": {
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@graphql-codegen/cli": "2.6.2",
|
|
23
|
-
"@graphql-mesh/cli": "0.
|
|
24
|
-
"@graphql-mesh/types": "0.
|
|
25
|
-
"@graphql-mesh/utils": "0.
|
|
23
|
+
"@graphql-mesh/cli": "0.73.1",
|
|
24
|
+
"@graphql-mesh/types": "0.74.2",
|
|
25
|
+
"@graphql-mesh/utils": "0.35.6"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@graphcommerce/eslint-config-pwa": "^4.1.
|
|
28
|
+
"@graphcommerce/eslint-config-pwa": "^4.1.8",
|
|
29
29
|
"@graphcommerce/prettier-config-pwa": "^4.0.6",
|
|
30
30
|
"@graphcommerce/typescript-config-pwa": "^4.0.2",
|
|
31
31
|
"@playwright/test": "^1.21.1",
|
|
32
|
-
"typescript": "4.
|
|
32
|
+
"typescript": "4.7.3"
|
|
33
33
|
},
|
|
34
34
|
"sideEffects": false,
|
|
35
35
|
"prettier": "@graphcommerce/prettier-config-pwa",
|