@graphcommerce/cli 5.2.0-canary.8 → 6.0.0-canary.20
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 +24 -0
- package/dist/bin/graphcommerce.js +15 -1
- package/dist/bin/mesh.js +6 -1
- package/package.json +16 -12
- package/{bin → src/bin}/codegen.ts +0 -0
- package/src/bin/graphcommerce.ts +22 -0
- package/{bin → src/bin}/is-monorepo.ts +0 -0
- package/{bin → src/bin}/mesh.ts +8 -2
- package/{index.ts → src/index.ts} +0 -0
- package/{utils → src/utils}/findConfig.ts +0 -0
- package/tsconfig.json +10 -7
- package/bin/graphcommerce.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @graphcommerce/cli
|
|
2
2
|
|
|
3
|
+
## 6.0.0-canary.20
|
|
4
|
+
|
|
5
|
+
## 5.2.0-canary.19
|
|
6
|
+
|
|
7
|
+
## 5.2.0-canary.18
|
|
8
|
+
|
|
9
|
+
## 5.2.0-canary.17
|
|
10
|
+
|
|
11
|
+
## 5.2.0-canary.16
|
|
12
|
+
|
|
13
|
+
## 5.2.0-canary.15
|
|
14
|
+
|
|
15
|
+
## 5.2.0-canary.14
|
|
16
|
+
|
|
17
|
+
## 5.2.0-canary.13
|
|
18
|
+
|
|
19
|
+
## 5.2.0-canary.12
|
|
20
|
+
|
|
21
|
+
## 5.2.0-canary.11
|
|
22
|
+
|
|
23
|
+
## 5.2.0-canary.10
|
|
24
|
+
|
|
25
|
+
## 5.2.0-canary.9
|
|
26
|
+
|
|
3
27
|
## 5.2.0-canary.8
|
|
4
28
|
|
|
5
29
|
## 5.2.0-canary.7
|
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const next_config_1 = require("@graphcommerce/next-config");
|
|
5
|
+
const commands = {
|
|
6
|
+
'codegen-config': next_config_1.generateConfig,
|
|
7
|
+
};
|
|
8
|
+
const args = process.argv.slice(2);
|
|
9
|
+
const command = args[0];
|
|
10
|
+
if (!commands[command]) {
|
|
11
|
+
console.error(`Unknown command: ${args.join(' ')}, possible commands: ${Object.keys(commands).join(', ')}`);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
commands[command]().catch((e) => {
|
|
15
|
+
console.error(e);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
});
|
package/dist/bin/mesh.js
CHANGED
|
@@ -88,7 +88,12 @@ const main = async () => {
|
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
90
|
];
|
|
91
|
-
|
|
91
|
+
const replacers = (0, next_config_1.configToImportMeta)((0, next_config_1.loadConfig)(root));
|
|
92
|
+
let yamlString = yaml_1.default.stringify(conf);
|
|
93
|
+
Object.entries(replacers).forEach(([from, to]) => {
|
|
94
|
+
yamlString = yamlString.replace(new RegExp(`"{${from}}"`, 'g'), to);
|
|
95
|
+
});
|
|
96
|
+
await node_fs_1.promises.writeFile(tmpMeshLocation, yamlString);
|
|
92
97
|
// Reexport the mesh to is can be used by packages
|
|
93
98
|
await node_fs_1.promises.writeFile(`${meshDir}/.mesh.ts`, `export * from '${relativePath.split(node_path_1.default.sep).join('/')}.mesh'`, { encoding: 'utf8' });
|
|
94
99
|
await (0, cli_1.graphqlMesh)({ ...cliParams, configName: tmpMesh });
|
package/package.json
CHANGED
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
"name": "@graphcommerce/cli",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "6.0.0-canary.20",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"dev": "tsc --preserveWatchOutput --watch
|
|
10
|
-
"build": "tsc
|
|
11
|
-
"prepack": "
|
|
9
|
+
"dev": "tsc --preserveWatchOutput --watch",
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"prepack": "tsc"
|
|
12
12
|
},
|
|
13
|
+
"type": "commonjs",
|
|
13
14
|
"main": "dist/index.js",
|
|
15
|
+
"types": "src/index.ts",
|
|
14
16
|
"bin": {
|
|
15
17
|
"mesh": "dist/bin/mesh.js",
|
|
16
18
|
"gql-mesh": "dist/bin/mesh.js",
|
|
@@ -22,23 +24,25 @@
|
|
|
22
24
|
"graphcommerce": "dist/bin/graphcommerce.js"
|
|
23
25
|
},
|
|
24
26
|
"dependencies": {
|
|
25
|
-
"@graphcommerce/next-config": "
|
|
26
|
-
"@graphql-codegen/cli": "
|
|
27
|
-
"@graphql-mesh/cli": "0.82.
|
|
28
|
-
"@graphql-mesh/types": "0.
|
|
29
|
-
"@graphql-mesh/utils": "0.43.
|
|
27
|
+
"@graphcommerce/next-config": "6.0.0-canary.20",
|
|
28
|
+
"@graphql-codegen/cli": "3.0.0",
|
|
29
|
+
"@graphql-mesh/cli": "0.82.14",
|
|
30
|
+
"@graphql-mesh/types": "0.90.0",
|
|
31
|
+
"@graphql-mesh/utils": "0.43.7",
|
|
30
32
|
"cosmiconfig": "^8.0.0",
|
|
31
33
|
"detect-package-manager": "^2.0.1",
|
|
32
34
|
"graphql": "16.6.0",
|
|
35
|
+
"graphql-codegen-typescript-validation-schema": "^0.7.1",
|
|
33
36
|
"graphql-tag": "^2.12.6",
|
|
34
37
|
"rimraf": "^3.0.2",
|
|
35
38
|
"ts-node": "^10.9.1"
|
|
36
39
|
},
|
|
37
40
|
"devDependencies": {
|
|
38
|
-
"@graphcommerce/eslint-config-pwa": "
|
|
39
|
-
"@graphcommerce/prettier-config-pwa": "
|
|
40
|
-
"@graphcommerce/typescript-config-pwa": "
|
|
41
|
+
"@graphcommerce/eslint-config-pwa": "6.0.0-canary.20",
|
|
42
|
+
"@graphcommerce/prettier-config-pwa": "6.0.0-canary.20",
|
|
43
|
+
"@graphcommerce/typescript-config-pwa": "6.0.0-canary.20",
|
|
41
44
|
"@types/rimraf": "^3.0.2",
|
|
45
|
+
"react": "^18.2.0",
|
|
42
46
|
"typescript": "4.9.4"
|
|
43
47
|
},
|
|
44
48
|
"sideEffects": false,
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { generateConfig } from '@graphcommerce/next-config'
|
|
4
|
+
|
|
5
|
+
const commands = {
|
|
6
|
+
'codegen-config': generateConfig,
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const args = process.argv.slice(2)
|
|
10
|
+
const command = args[0] as keyof typeof commands
|
|
11
|
+
|
|
12
|
+
if (!commands[command]) {
|
|
13
|
+
console.error(
|
|
14
|
+
`Unknown command: ${args.join(' ')}, possible commands: ${Object.keys(commands).join(', ')}`,
|
|
15
|
+
)
|
|
16
|
+
process.exit(1)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
commands[command]().catch((e) => {
|
|
20
|
+
console.error(e)
|
|
21
|
+
process.exit(1)
|
|
22
|
+
})
|
|
File without changes
|
package/{bin → src/bin}/mesh.ts
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { promises as fs } from 'node:fs'
|
|
4
4
|
import path from 'node:path'
|
|
5
5
|
import { exit } from 'node:process'
|
|
6
|
-
import { isMonorepo } from '@graphcommerce/next-config'
|
|
6
|
+
import { configToImportMeta, isMonorepo, loadConfig } from '@graphcommerce/next-config'
|
|
7
7
|
import { graphqlMesh, DEFAULT_CLI_PARAMS, GraphQLMeshCLIParams } from '@graphql-mesh/cli'
|
|
8
8
|
import { Logger, YamlConfig } from '@graphql-mesh/types'
|
|
9
9
|
import { DefaultLogger } from '@graphql-mesh/utils'
|
|
@@ -92,7 +92,13 @@ const main = async () => {
|
|
|
92
92
|
},
|
|
93
93
|
]
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
const replacers = configToImportMeta(loadConfig(root))
|
|
96
|
+
let yamlString = yaml.stringify(conf)
|
|
97
|
+
Object.entries(replacers).forEach(([from, to]) => {
|
|
98
|
+
yamlString = yamlString.replace(new RegExp(`"{${from}}"`, 'g'), to)
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
await fs.writeFile(tmpMeshLocation, yamlString)
|
|
96
102
|
|
|
97
103
|
// Reexport the mesh to is can be used by packages
|
|
98
104
|
await fs.writeFile(
|
|
File without changes
|
|
File without changes
|
package/tsconfig.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"exclude": ["**/node_modules", "**/.*/"],
|
|
2
|
+
"exclude": ["**/node_modules", "example", "dist", "**/.*/", "__tests__", "__mocks__"],
|
|
3
3
|
"include": ["**/*.ts", "**/*.tsx"],
|
|
4
4
|
"files": [
|
|
5
|
-
"bin/codegen.ts",
|
|
6
|
-
"bin/mesh.ts",
|
|
7
|
-
"bin/graphcommerce.ts",
|
|
8
|
-
"bin/is-monorepo.ts",
|
|
9
|
-
"index.ts"
|
|
5
|
+
"src/bin/codegen.ts",
|
|
6
|
+
"src/bin/mesh.ts",
|
|
7
|
+
"src/bin/graphcommerce.ts",
|
|
8
|
+
"src/bin/is-monorepo.ts",
|
|
9
|
+
"src/index.ts"
|
|
10
10
|
],
|
|
11
11
|
"extends": "@graphcommerce/typescript-config-pwa/node.json",
|
|
12
12
|
"compilerOptions": {
|
|
13
|
+
"rootDir": "src",
|
|
13
14
|
"noEmit": false,
|
|
14
15
|
"outDir": "dist",
|
|
15
|
-
"sourceMap": false
|
|
16
|
+
"sourceMap": false,
|
|
17
|
+
"noLib": false,
|
|
18
|
+
"strict": true
|
|
16
19
|
}
|
|
17
20
|
}
|
package/bin/graphcommerce.ts
DELETED