Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/core/src/bin/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ addToGlobalContext('cliVersion', version);

const handleCommandFailure = async (logFilePath: string | boolean): Promise<never> => {
const logFile = await logTracker.writeToFile(logFilePath);
logger.log(`Storybook debug logs can be found at: ${logFile}`);
logger.log(`Debug logs are written to: ${logFile}`);
logger.outro('Storybook exited with an error');
process.exit(1);
};
Expand Down Expand Up @@ -67,7 +67,7 @@ const command = (name: string) =>
.hook('postAction', async (command) => {
if (logTracker.shouldWriteLogsToFile) {
const logFile = await logTracker.writeToFile(command.getOptionValue('logfile'));
logger.outro(`Storybook debug logs can be found at: ${logFile}`);
logger.outro(`Debug logs are written to: ${logFile}`);
}
});

Expand Down
6 changes: 2 additions & 4 deletions code/core/src/node-logger/logger/log-tracker.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { promises as fs } from 'node:fs';
import path, { join } from 'node:path';

import { isCI } from 'storybook/internal/common';
import { join } from 'node:path';

import type { LogLevel } from './logger';

Expand Down Expand Up @@ -90,7 +88,7 @@ class LogTracker {
await fs.writeFile(logFilePath, logContent, 'utf-8');
this.#logs = [];

return isCI() ? logFilePath : path.relative(process.cwd(), logFilePath);
return logFilePath;
}
}

Expand Down
4 changes: 2 additions & 2 deletions code/lib/cli-storybook/src/bin/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const handleCommandFailure =
}

const logFile = await logTracker.writeToFile(logFilePath);
logger.log(`Storybook debug logs can be found at: ${logFile}`);
logger.log(`Debug logs are written to: ${logFile}`);
logger.outro('');
process.exit(1);
};
Expand Down Expand Up @@ -80,7 +80,7 @@ const command = (name: string) =>
.hook('postAction', async ({ getOptionValue }) => {
if (logTracker.shouldWriteLogsToFile) {
const logFile = await logTracker.writeToFile(getOptionValue('logfile'));
logger.log(`Storybook debug logs can be found at: ${logFile}`);
logger.log(`Debug logs are written to: ${logFile}`);
logger.outro(CLI_COLORS.success('Done!'));
}
});
Expand Down
6 changes: 4 additions & 2 deletions code/lib/create-storybook/src/commands/FinalizationCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ export class FinalizationCommand {
}

private async printFailureMessage(storybookCommand?: string | null): Promise<void> {
logger.warn('Storybook setup completed, but some non-blocking errors occurred.');
logger.warn(
'Storybook setup completed, but some non-blocking errors occurred. Please check the log file below for details.'
);
this.printNextSteps(storybookCommand);

const logFile = await logTracker.writeToFile(this.logfile);
logger.warn(`Storybook debug logs can be found at: ${logFile}`);
logger.warn(`Debug logs are written to: ${logFile}`);
}

/** Print success message with feature summary */
Expand Down
2 changes: 1 addition & 1 deletion code/lib/create-storybook/src/initiate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export async function doInitiate(options: CommandOptions): Promise<
const handleCommandFailure = async (logFilePath: string | boolean | undefined): Promise<never> => {
const logFile = await logTracker.writeToFile(logFilePath);
logger.error('Storybook encountered an error during initialization');
logger.log(`Storybook debug logs can be found at: ${logFile}`);
logger.log(`Debug logs are written to: ${logFile}`);
logger.outro('Storybook exited with an error');
process.exit(1);
};
Expand Down
Loading