@ooneex/cli 1.40.1 → 1.41.0

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/dist/index.js CHANGED
@@ -7140,6 +7140,62 @@ var createSpinner = (message) => {
7140
7140
  }
7141
7141
  };
7142
7142
  };
7143
+ var logSubprocessError = (stderr, logger) => {
7144
+ const opts = { showTimestamp: false, showArrow: false, useSymbol: false };
7145
+ const dim = (s) => `\x1B[2m${s}\x1B[0m`;
7146
+ const isCodeContextLine = (raw, trimmed) => /^\d+\s*\|/.test(trimmed) || /^\s*\^+\s*$/.test(raw);
7147
+ const lines = stderr.split(`
7148
+ `);
7149
+ const pendingContext = [];
7150
+ let currentMessage = "";
7151
+ let currentFrames = [];
7152
+ const flush = () => {
7153
+ if (!currentMessage)
7154
+ return;
7155
+ logger.error(currentMessage, undefined, opts);
7156
+ const visible = currentFrames.slice(0, 5);
7157
+ for (const frame of visible) {
7158
+ process.stderr.write(` ${dim(frame)}
7159
+ `);
7160
+ }
7161
+ if (currentFrames.length > 5) {
7162
+ process.stderr.write(` ${dim(`... and ${currentFrames.length - 5} more`)}
7163
+ `);
7164
+ }
7165
+ currentMessage = "";
7166
+ currentFrames = [];
7167
+ };
7168
+ for (const line of lines) {
7169
+ const trimmed = line.trim();
7170
+ if (!trimmed)
7171
+ continue;
7172
+ if (trimmed.startsWith("at ")) {
7173
+ currentFrames.push(trimmed);
7174
+ } else if (isCodeContextLine(line, trimmed)) {
7175
+ flush();
7176
+ pendingContext.push(line.trimEnd());
7177
+ } else {
7178
+ if (pendingContext.length > 0) {
7179
+ process.stderr.write(`
7180
+ `);
7181
+ for (const ctx of pendingContext)
7182
+ process.stderr.write(`${dim(ctx)}
7183
+ `);
7184
+ pendingContext.length = 0;
7185
+ }
7186
+ flush();
7187
+ currentMessage = trimmed;
7188
+ }
7189
+ }
7190
+ if (pendingContext.length > 0) {
7191
+ process.stderr.write(`
7192
+ `);
7193
+ for (const ctx of pendingContext)
7194
+ process.stderr.write(`${dim(ctx)}
7195
+ `);
7196
+ }
7197
+ flush();
7198
+ };
7143
7199
  var ensureModule = async (module) => {
7144
7200
  const moduleDir = join3(process.cwd(), "modules", module);
7145
7201
  const moduleDirExists = await Bun.file(join3(moduleDir, "package.json")).exists();
@@ -99236,8 +99292,9 @@ class MigrationUpCommand {
99236
99292
  });
99237
99293
  } else {
99238
99294
  const errorOutput = await new Response(proc.stderr).text();
99239
- const trimmed = errorOutput.trim();
99240
- logger.error(`Migrations failed for ${name} (exit code: ${exitCode})`, trimmed ? { message: trimmed } : undefined, {
99295
+ if (errorOutput.trim())
99296
+ logSubprocessError(errorOutput, logger);
99297
+ logger.error(`Migrations failed for ${name} (exit code: ${exitCode})`, undefined, {
99241
99298
  showTimestamp: false,
99242
99299
  showArrow: false,
99243
99300
  useSymbol: true
@@ -99654,8 +99711,9 @@ class SeedRunCommand {
99654
99711
  });
99655
99712
  } else {
99656
99713
  const errorOutput = await new Response(proc.stderr).text();
99657
- const trimmed = errorOutput.trim();
99658
- logger.error(`Seeds failed for ${name} (exit code: ${exitCode})`, trimmed ? { message: trimmed } : undefined, {
99714
+ if (errorOutput.trim())
99715
+ logSubprocessError(errorOutput, logger);
99716
+ logger.error(`Seeds failed for ${name} (exit code: ${exitCode})`, undefined, {
99659
99717
  showTimestamp: false,
99660
99718
  showArrow: false,
99661
99719
  useSymbol: true
@@ -99670,4 +99728,4 @@ SeedRunCommand = __legacyDecorateClassTS([
99670
99728
  // src/index.ts
99671
99729
  await run();
99672
99730
 
99673
- //# debugId=61AFC67C24C1FDDE64756E2164756E21
99731
+ //# debugId=66DF020982EECE7364756E2164756E21