poe-code 3.0.287 → 3.0.288

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": "poe-code",
3
- "version": "3.0.287",
3
+ "version": "3.0.288",
4
4
  "description": "CLI tool to configure Poe API for developer workflows.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -55,6 +55,11 @@ export async function runGenerateCli(argv = process.argv, services = {
55
55
  if (result.diagnostics.length > 0) {
56
56
  services.stderr.write(formatDiagnostics(result.diagnostics));
57
57
  }
58
+ const diagnosticsFailed = hasErrorDiagnostics(result.diagnostics);
59
+ if (!parsed.check && !parsed.diff && diagnosticsFailed) {
60
+ services.stderr.write("OpenAPI diagnostics failed for toolcraft.yml.\n");
61
+ return 1;
62
+ }
58
63
  if (parsed.diff) {
59
64
  if (!result.drifted) {
60
65
  services.stdout.write(`OpenAPI output is up to date (${result.specSha}).\n`);
@@ -68,7 +73,7 @@ export async function runGenerateCli(argv = process.argv, services = {
68
73
  services.stderr.write(`OpenAPI output is out of date for ${parsed.outputDir}. Run the generator without --check to update it.\n`);
69
74
  return 1;
70
75
  }
71
- if (hasErrorDiagnostics(result.diagnostics)) {
76
+ if (diagnosticsFailed) {
72
77
  services.stderr.write("OpenAPI diagnostics failed for toolcraft.yml.\n");
73
78
  return 1;
74
79
  }
@@ -116,7 +121,7 @@ export async function syncGeneratedClient(options, services) {
116
121
  const updatedFiles = collectUpdatedFiles(currentFiles, desiredFiles);
117
122
  const deletedFiles = collectDeletedFiles(currentFiles, desiredFiles);
118
123
  const drifted = updatedFiles.length > 0 || deletedFiles.length > 0;
119
- if (!options.check && !options.diff && drifted) {
124
+ if (!options.check && !options.diff && drifted && !hasErrorDiagnostics(diagnostics)) {
120
125
  try {
121
126
  await writeGeneratedFiles(services.fs, outputDir, updatedFiles);
122
127
  await deleteGeneratedFiles(services.fs, outputDir, deletedFiles);