wgc 0.44.2 → 0.45.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wgc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.1",
|
|
4
4
|
"description": "The official CLI tool to manage the GraphQL Federation Platform Cosmo",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@bufbuild/protobuf": "^1.4.1",
|
|
34
34
|
"@connectrpc/connect": "^1.1.3",
|
|
35
35
|
"@connectrpc/connect-node": "^1.1.3",
|
|
36
|
-
"@wundergraph/composition": "0.
|
|
37
|
-
"@wundergraph/cosmo-connect": "0.
|
|
38
|
-
"@wundergraph/cosmo-shared": "0.
|
|
36
|
+
"@wundergraph/composition": "0.20.0",
|
|
37
|
+
"@wundergraph/cosmo-connect": "0.61.0",
|
|
38
|
+
"@wundergraph/cosmo-shared": "0.21.0",
|
|
39
39
|
"boxen": "^7.1.1",
|
|
40
40
|
"cli-progress": "^3.12.0",
|
|
41
41
|
"cli-table3": "^0.6.3",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"typescript": "^5.2.2",
|
|
71
71
|
"vitest": "^0.34.1"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "1ad9a19ca38b657f1e8230e7d6b5ccf8e0f84bac"
|
|
74
74
|
}
|
|
@@ -86,7 +86,6 @@ export default (opts: BaseCommandOptions) => {
|
|
|
86
86
|
|
|
87
87
|
const changesTable = new Table({
|
|
88
88
|
head: [pc.bold(pc.white('CHANGE')), pc.bold(pc.white('TYPE')), pc.bold(pc.white('DESCRIPTION'))],
|
|
89
|
-
colWidths: [15, 30, 80],
|
|
90
89
|
wordWrap: true,
|
|
91
90
|
});
|
|
92
91
|
|
|
@@ -100,12 +99,22 @@ export default (opts: BaseCommandOptions) => {
|
|
|
100
99
|
wordWrap: true,
|
|
101
100
|
});
|
|
102
101
|
|
|
102
|
+
const lintIssuesTable = new Table({
|
|
103
|
+
head: [pc.bold(pc.white('LINT_RULE')), pc.bold(pc.white('ERROR_MESSAGE')), pc.bold(pc.white('LINE NUMBER'))],
|
|
104
|
+
colAligns: ['left', 'left', 'center'],
|
|
105
|
+
wordWrap: true,
|
|
106
|
+
});
|
|
107
|
+
|
|
103
108
|
let success = false;
|
|
104
109
|
let finalStatement = '';
|
|
105
110
|
|
|
106
111
|
let studioCheckDestination = '';
|
|
107
112
|
if (resp.checkId && resp.checkedFederatedGraphs.length > 0) {
|
|
108
|
-
studioCheckDestination =
|
|
113
|
+
studioCheckDestination = `${pc.bold('Open in studio')}: ${config.webURL}/${
|
|
114
|
+
resp.checkedFederatedGraphs[0].organizationSlug
|
|
115
|
+
}/${resp.checkedFederatedGraphs[0].namespace}/graph/${resp.checkedFederatedGraphs[0].name}/checks/${
|
|
116
|
+
resp.checkId
|
|
117
|
+
}`;
|
|
109
118
|
}
|
|
110
119
|
|
|
111
120
|
switch (resp.response?.code) {
|
|
@@ -113,9 +122,11 @@ export default (opts: BaseCommandOptions) => {
|
|
|
113
122
|
if (
|
|
114
123
|
resp.nonBreakingChanges.length === 0 &&
|
|
115
124
|
resp.breakingChanges.length === 0 &&
|
|
116
|
-
resp.compositionErrors.length === 0
|
|
125
|
+
resp.compositionErrors.length === 0 &&
|
|
126
|
+
resp.lintErrors.length === 0 &&
|
|
127
|
+
resp.lintWarnings.length === 0
|
|
117
128
|
) {
|
|
118
|
-
console.log(`\nDetected no changes.\n${studioCheckDestination}\n`);
|
|
129
|
+
console.log(`\nDetected no changes.\nDetected no lint issues.\n\n${studioCheckDestination}\n`);
|
|
119
130
|
|
|
120
131
|
success = true;
|
|
121
132
|
|
|
@@ -167,13 +178,21 @@ export default (opts: BaseCommandOptions) => {
|
|
|
167
178
|
|
|
168
179
|
if (resp.breakingChanges.length > 0) {
|
|
169
180
|
for (const breakingChange of resp.breakingChanges) {
|
|
170
|
-
changesTable.push([
|
|
181
|
+
changesTable.push([
|
|
182
|
+
`${logSymbols.error} ${pc.red('BREAKING')}`,
|
|
183
|
+
breakingChange.changeType,
|
|
184
|
+
breakingChange.message,
|
|
185
|
+
]);
|
|
171
186
|
}
|
|
172
187
|
}
|
|
173
188
|
|
|
174
189
|
if (resp.nonBreakingChanges.length > 0) {
|
|
175
190
|
for (const nonBreakingChange of resp.nonBreakingChanges) {
|
|
176
|
-
changesTable.push([
|
|
191
|
+
changesTable.push([
|
|
192
|
+
`${logSymbols.success} NON-BREAKING`,
|
|
193
|
+
nonBreakingChange.changeType,
|
|
194
|
+
nonBreakingChange.message,
|
|
195
|
+
]);
|
|
177
196
|
}
|
|
178
197
|
}
|
|
179
198
|
|
|
@@ -192,12 +211,32 @@ export default (opts: BaseCommandOptions) => {
|
|
|
192
211
|
console.log(compositionErrorsTable.toString());
|
|
193
212
|
}
|
|
194
213
|
|
|
214
|
+
if (resp.lintErrors.length > 0 || resp.lintWarnings.length > 0) {
|
|
215
|
+
success = resp.lintErrors.length === 0;
|
|
216
|
+
console.log('\nDetected lint issues:');
|
|
217
|
+
for (const error of resp.lintErrors) {
|
|
218
|
+
lintIssuesTable.push([
|
|
219
|
+
`${logSymbols.error} ${pc.red(error.lintRuleType)}`,
|
|
220
|
+
error.message,
|
|
221
|
+
error.issueLocation?.line,
|
|
222
|
+
]);
|
|
223
|
+
}
|
|
224
|
+
for (const warning of resp.lintWarnings) {
|
|
225
|
+
lintIssuesTable.push([
|
|
226
|
+
`${logSymbols.warning} ${pc.yellow(warning.lintRuleType)}`,
|
|
227
|
+
warning.message,
|
|
228
|
+
warning.issueLocation?.line,
|
|
229
|
+
]);
|
|
230
|
+
}
|
|
231
|
+
console.log(lintIssuesTable.toString());
|
|
232
|
+
}
|
|
233
|
+
|
|
195
234
|
if (success) {
|
|
196
235
|
console.log(
|
|
197
236
|
'\n' +
|
|
198
237
|
logSymbols.success +
|
|
199
238
|
pc.green(` Schema check passed. ${finalStatement}`) +
|
|
200
|
-
'\n' +
|
|
239
|
+
'\n\n' +
|
|
201
240
|
studioCheckDestination +
|
|
202
241
|
'\n',
|
|
203
242
|
);
|