@vladimirdev635/gql-codegen 0.0.115 → 0.0.117
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/actors/text-diff.js
CHANGED
|
@@ -58,30 +58,30 @@ const n = 10;
|
|
|
58
58
|
function printLine(state, part, line) {
|
|
59
59
|
if (part.added) {
|
|
60
60
|
if (state.beforeBufferList.length !== 0) {
|
|
61
|
-
process.
|
|
61
|
+
process.stderr.write(buildSeparatorLine(state.newLineNumber, state.oldLineNumber) +
|
|
62
62
|
'\n');
|
|
63
|
-
process.
|
|
63
|
+
process.stderr.write(state.beforeBufferList.join('\n') + '\n');
|
|
64
64
|
state.beforeBufferList = [];
|
|
65
65
|
}
|
|
66
66
|
state.nextN = n;
|
|
67
|
-
process.
|
|
67
|
+
process.stderr.write(formatLine(state.newLineNumber, state.oldLineNumber, LineType.Added, line) + '\n');
|
|
68
68
|
state.newLineNumber++;
|
|
69
69
|
}
|
|
70
70
|
else if (part.removed) {
|
|
71
71
|
if (state.beforeBufferList.length !== 0) {
|
|
72
|
-
process.
|
|
72
|
+
process.stderr.write(buildSeparatorLine(state.newLineNumber, state.oldLineNumber) +
|
|
73
73
|
'\n');
|
|
74
|
-
process.
|
|
74
|
+
process.stderr.write(state.beforeBufferList.join('\n') + '\n');
|
|
75
75
|
state.beforeBufferList = [];
|
|
76
76
|
}
|
|
77
77
|
state.nextN = n;
|
|
78
|
-
process.
|
|
78
|
+
process.stderr.write(formatLine(state.newLineNumber, state.oldLineNumber, LineType.Removed, line) + '\n');
|
|
79
79
|
state.oldLineNumber++;
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
82
|
const formattedLine = formatLine(state.newLineNumber, state.oldLineNumber, LineType.Unchanged, line);
|
|
83
83
|
if (state.nextN !== 0) {
|
|
84
|
-
process.
|
|
84
|
+
process.stderr.write(formattedLine + '\n');
|
|
85
85
|
state.nextN -= 1;
|
|
86
86
|
}
|
|
87
87
|
else {
|
|
@@ -16,7 +16,7 @@ export function generateSubscriptionHookType(config) {
|
|
|
16
16
|
], generateSubscriptionHookReturnType(ts.factory.createTypeReferenceNode('TResult'))));
|
|
17
17
|
}
|
|
18
18
|
export function generateSubscriptionHookBuilder(config) {
|
|
19
|
-
return ts.factory.createFunctionDeclaration(undefined, undefined, config.sdk.
|
|
19
|
+
return ts.factory.createFunctionDeclaration(undefined, undefined, config.sdk.subscriptionHookBuilderName, [
|
|
20
20
|
ts.factory.createTypeParameterDeclaration(undefined, 'TExecutor', ts.factory.createTypeReferenceNode('types.IExecutor', [
|
|
21
21
|
ts.factory.createTypeReferenceNode('TRequestContext'),
|
|
22
22
|
])),
|
package/actors/utils.js
CHANGED
|
@@ -14,9 +14,11 @@ export function executeRunAction(outPath, action, code) {
|
|
|
14
14
|
const fileCode = fs.readFileSync(outPath).toString();
|
|
15
15
|
if (fileCode !== code) {
|
|
16
16
|
const changes = diffLines(fileCode, code);
|
|
17
|
-
process.
|
|
17
|
+
process.stderr.write(pc.blue(`${path.relative(process.cwd(), outPath.toString())}:\n`));
|
|
18
18
|
printChanges(changes);
|
|
19
|
+
process.exit(1);
|
|
19
20
|
}
|
|
21
|
+
process.stdout.write('Code is up to date\n');
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
}
|