Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

outputs(install) - add link about env.jsonc and improve bit install warning's text #7650

Merged
merged 1 commit into from
Jul 16, 2023
Merged
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
20 changes: 7 additions & 13 deletions scopes/workspace/install/install.cmd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,22 +135,16 @@ function formatOutput({
}

export function getAnotherInstallRequiredOutput(recurringInstall = false, oldNonLoadedEnvs: string[] = []): string {
// oldNonLoadedEnvs = ['my-org.my-scope/envs/my-react-env']
if (!oldNonLoadedEnvs.length) return '';
const oldNonLoadedEnvsStr = oldNonLoadedEnvs.join(', ');
const firstPart = `The following environments are not loaded: ${chalk.cyan(
oldNonLoadedEnvsStr
)} and doesn't contain env.jsonc file`;
const docsLink = `Read more about how to fix this issue in:`;
const installAgain = `Please run "bit install" again to make sure all dependencies installed correctly`;
const firstPart = `Bit is unable to install all dependencies. Please run "${chalk.cyan('bit install')}" again `;
const flag = chalk.cyan(`--${recurringInstallFlagName}`);
const suggestRecurringInstall = `You can add the ${flag} flag to automatically run "bit install" again. but it is recommended to fix this issue`;
let msg = `${firstPart}\n${installAgain}\n${suggestRecurringInstall}\n${docsLink}`;
const suggestRecurringInstall = recurringInstall ? '' : `(or use the "${flag}" option next time).`;
const envsStr = `The following environments need to add support for "dependency policy" to fix the warning: ${chalk.cyan(
oldNonLoadedEnvsStr
)}`;
const docsLink = `Read more about how to fix this issue in: https://bit.dev/blog/using-a-static-dependency-policy-in-a-legacy-env-lihfbt9b`;

if (recurringInstall) {
const autoInstallAgain =
'bit run install again for you to make sure all dependencies installed correctly, but it is recommended to fix this issue';
msg = `${firstPart}\n${autoInstallAgain}\n${docsLink}`;
}
const msg = `${firstPart}${suggestRecurringInstall}\n${envsStr}\n${docsLink}`;
return chalk.yellow(msg);
}